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
When starting multiple Julia's and using GAP.jl in each of them, there can be issues caused by the shared faux gaproot in a scratch space, despite pidlocking.
To quote myself from Slack:
I guess there is a problem if process 1 loads GAP.jl and is past creating the scratch space and actively loading GAP; then process 2 deletes and recreates the scratch space. Then for a brief moment, the faux GAP root is gone and reads from paths relative to it will fail.
Strictly speaking this can of course also happen at any point after GAP initialization: if something deletes the scratch space it uses, then we have a problem.
Two solutions comes to mind:
let each GAP.jl instance have its own faux gaproot. To that end, each process creates its own subdir of the GAP.jl scratch space (e.g. with a name based on its PID, possibly plus a random part). Use mktempdir(gap_scratch_space_dir; cleanup = true) to get the path, ensuring that it is deleted afterwards. In that case the pid locking could also go, as it would be "built in", so to say.
change the code re-creating the faux gaproot to be more defensive: force_symlink could be made less brutal: instead of force creating the new symlink, check if it already exists and points at the right path, if it does, just leave it alone. Likewise the code which recreates sysinfo.gap & gac could first assemble the new file content in a string; then read the existing file and compare; and only overwrite it if the content changed.
With approach 2, there could still cause problems if there are actual changes in the symlink paths. To protect against that, the (hashes of) the paths to the relevant artifact (gap_packages, GAP_jll, GAP_lib_jll) could become part of the Scratchspace name.
The text was updated successfully, but these errors were encountered:
When starting multiple Julia's and using GAP.jl in each of them, there can be issues caused by the shared faux gaproot in a scratch space, despite pidlocking.
To quote myself from Slack:
The text was updated successfully, but these errors were encountered: