Open
Description
I'm looking at an error thrown in a Rails application which uses v2.0.2 of execjs. I think it may be due to a potential race condition in this method, but I want to
- validate my understanding of the error thrown
- check, if my understanding is correct and this has been repaired in a later version of the gem, whether a simple upgrade may resolve the errors
For completeness, the method body (which no longer exists in this manner on most recent version) is
def exec_runtime(filename)
output = sh("#{shell_escape(*(binary.split(' ') << filename))} 2>&1")
if $?.success?
output
else
raise RuntimeError, output
end
end
My understanding so far is that, if the most recent exit code is non-zero, the runtime will raise RuntimeError
with the shell output even if the shell script executed successfully. The most recent exit code would not have been from the shell script supplying the output -- i.e. a race condition in examining $?
Thank you for your help.
Metadata
Metadata
Assignees
Labels
No labels