-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protect against SANY race conditions on the filesystem #3046
Conversation
src/universal/bin/apalache-mc
Outdated
TMPDIR="$(pwd)/tmp" | ||
mkdir -p "$TMPDIR" | ||
fi | ||
JAVA_IO_TMPDIR=`mktemp -d -p $TMPDIR -t SANYXXXXXXXXXX` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not skip -p
(and the above) and rely on it's default behavior:
-p temp-dir, --tmpdir=temp-dir
temp directory for the file. This option is a member of the
tmpdir class of options.
If this option is not provided, mktemp will use the environment
variable TMPDIR to find a suitable directory. If these are not
available, it will fall back to ~/tmp or /tmp. A <file-pat>
command line argument containing a directory component will con-
flict with this option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, it does not work with docker this way. Maybe it's using nix and it has different behavior. But it does not even work with my fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above test was failing due to extra protection flags, now using ${TMPDIR:-}
. This works. Let me see how it works without -p
. It definitely did not work without the additional test for TMPDIR
above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one question (see above), so I've disabled auto-merge.
But in general, LGTM
Although rare, it may still happen that multiple CLI instances of Apalache hit concurrency issues that is filed in tlaplus/tlaplus#688 (
apalache-mc server
has a separate mutex for that):This is a simple fix that was already discussed in tlaplus/tlaplus#688. We simply set
java.io.tmpdir
to a specific directory.Actually, it seems like we have fixed it in #1959, but the above test shows otherwise.
./unreleased/
for any new functionality