-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Concurrency Bug between isAlive() and exitValue() in ManagedProcess and/or in DefaultExecuteResultHandler #108
Labels
Comments
Oh wait I forgot ... I will just replace it with a new |
vorburger
added a commit
that referenced
this issue
May 13, 2023
vorburger
added a commit
that referenced
this issue
May 13, 2023
vorburger
added a commit
that referenced
this issue
May 13, 2023
vorburger
added a commit
that referenced
this issue
May 13, 2023
vorburger
added a commit
that referenced
this issue
May 13, 2023
vorburger
added a commit
that referenced
this issue
May 13, 2023
This was referenced May 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
enola-dev/enola#163 may be due to a Concurrency Bug between
isAlive()
andexitValue()
?In
ManagedProcess#waitForExitMaxMsWithoutLog()
there is currently this:My original thinking was probably that because
checkResult()
doesresultHandler.hasResult()
this should be safe? But on 2nd thought, 10 years 😄 later, I wonder:hasResult()
(or, better, add a newhasExitValue()
) instead of!isAlive()
DefaultExecuteResultHandler
x3volatile
fieldshasResult
andexitValue
andexception
are not set "atomically"... that could be written better.Also, it's probably better to introduce separate new special values for
INVALID_EXITVALUE
instead of using that for several things would also make debug clearer. Or, probably better, just throw a new exception, in case of such clear inconsistent states - thatINVALID_EXITVALUE
is more confusing that really providing any useful feedback to a caller.I'll raise a PR with some work around this - and see if it helps me to stop runing into enola-dev/enola#163 while using https://docs.enola.dev/use/execmd.
@mosesn (from #103) and @cardamon (from #96) and @duttonw FYI.
The text was updated successfully, but these errors were encountered: