Possible Race Condition
还没有人认领这个 Issue。
评估
调研方向
Start with lib/execjs/external_runtime.rb lines 137-144 and the exec_runtime method shown in the issue. Reproduce or trace the reported error, then compare this implementation with the later gem version mentioned in the report. Done means establishing whether the exit-status check is racy and whether upgrading resolves the errors.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Ruby
- 星标
- 578
- 派生
- 285
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rails/execjs 的其他 Issue
-
Runtime stderr is missing from ruby error message可能已有人在做 @arpitjain099 于 145 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 65/100
alphagov/tech-docs-gem#580 ·
维护者通常 1 天内回复
-
Onboarding form: instructor radio never pre-selected "Yes" (permission vs permissions typo)可能已有人在做 @ThakuraAnki 今天认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 72/100
WikiEducationFoundation/WikiEduDashboard#7235 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
enhancement priority: low
难度 2/5 1-3 小时 新手友好度 72/100
davidteren/mutineer#361 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
zerocracy/judges-action#3021 ·
维护者通常 2 天内回复