lang/dotnet (e.g., 9.0.6): poudriere gets : unmount of /usr/local/poudriere/. . ./04/wrkdirs failed: Device busy; which prevents more

From: Mark Millard <marklmi_at_yahoo.com>
Date: Fri, 01 Aug 2025 00:30:00 UTC
[dotnet8 does not have this problem.]


The overall suggestion here is to possibly improve dotnet's
wkrdir-using activity to clean up after itself better,
avoiding leaving processes running that have files under
the jail's /wkrdir/ in use.


Context:

# tail -2 /usr/local/poudriere/data/logs/bulk/main-ZNV4-bulk_a-alt/2025-07-30_09h06m17s/logs/dotnet-9.0.6.log 
===>  Cleaning for dotnet-9.0.6
umount: unmount of /usr/local/poudriere/data/.m/main-ZNV4-bulk_a-alt/04/wrkdirs failed: Device busy

That, when it happens, in turn, leads to poudriere(-devel)'s status
always showing the likes of :

[04] 00:49:39                      lang/dotnet | dotnet-9.0.6                   build_port_done 00:06:49 4.75 GiB              

That effectively makes the builder unavailable for later builds
and prevents poudriere from completing as it waits for the status
to change.

I'm not the only one to see the behavior.

[In case it matters: AMD64, not Intel.]


New evidence that I noticed today . . .

I noticed something new to me in a new 'bulk -Ca' example
for the dotnet case. This was after:

[1D:06:34:29] [10] [00:00:43] Finished   lang/dotnet-host | dotnet-host-9.0.6: Success

and 'poudriere status' was reporting build_port_done : a
'ps -alxdww' then included:

 0 45401     1 20  45  0 406891940  200404 uwait    IJ    -      0:13.46 |-- /wrkdirs/usr/ports/lang/dotnet/work/bootstrap_sdk/dotnet /wrkdirs/usr/ports/lang/dotnet/work/bootstrap_sdk/sdk/9.0.103/MSBuild.dll /nologo /nodemode:1 /nodeReuse:true /low:false
 0 45402     1 29   0  0 406860132  201748 uwait    IJ    -      0:16.18 |-- /wrkdirs/usr/ports/lang/dotnet/work/bootstrap_sdk/dotnet /wrkdirs/usr/ports/lang/dotnet/work/bootstrap_sdk/sdk/9.0.103/MSBuild.dll /nologo /nodemode:1 /nodeReuse:true /low:false

but no other references to dotnet builder processes were
shown: no original parent process any more (other than
it had been reassigned to: 1). The paths above are
as they would be seen inside the poudriere builder's
jail, not as seen from the overall context.

Those are likely what lead to "Device busy" for the umount.

'kill 45401' worked, as did 'kill 45402' (but I was logged
in as root). That still left poudriere stuck at
build_port_done .

Can having /wrkdirs/usr/ports/lang/dotnet/work/bootstrap_sdk/dotnet
still running when "Cleaning for" starts in the jail be avoided?


===
Mark Millard
marklmi at yahoo.com