You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you start up a few separate processes concurrently that share the same table definition (and working area) sometimes the locking during table init fails outright like this:
error deleting "/var/tmp/adsb/c_aircraft_registry_faa.lock.lock": no such file or directory
while executing
"file delete $name.lock"
(procedure "unlockfile" line 20)
invoked from within
"unlockfile $lockfile"
(procedure "lockfile" line 71)
invoked from within
"lockfile $build_dir err"
(procedure "::stapi::init_ctable" line 30)
invoked from within
"::stapi::init_ctable aircraft_registry_faa "" "modescode IS NOT NULL AND active IS TRUE" modescode nnumber"
(procedure "create_stapi_tables" line 12)
invoked from within
"create_stapi_tables"
(procedure "main" line 88)
invoked from within
Additionally, sometimes in the same sort of situation, compilation will fail with bizarre errors because there are two processes trying to compile in the same place (i.e. the locking is not providing mutual exclusion).
The text was updated successfully, but these errors were encountered:
It looks like lockfile is fundamentally broken. It assumes that tcl's "file rename" without -force is atomic, i.e. it will either rename the file without clobbering, or fail.
This is not true. It first checks if the target exists. If the target does not exist, then it does a rename() call, which atomically replaces the target if it exists. There is a window between the test and the rename where another process could create the lockfile.
I'd suggest just using TclX's "flock" (open the lockfile in a+ mode, try to flock -nowait, keep the lockfile open until you want to release the lock)
I've created a "locking" branch off "stapi-test" to work on this. Creating the lockfile directly creates a potential race condition where the lockfile is created but the PID of the opener hasn't been put into it. I think I've handled that. Can you give it a try?
If you start up a few separate processes concurrently that share the same table definition (and working area) sometimes the locking during table init fails outright like this:
Additionally, sometimes in the same sort of situation, compilation will fail with bizarre errors because there are two processes trying to compile in the same place (i.e. the locking is not providing mutual exclusion).
The text was updated successfully, but these errors were encountered: