-
Notifications
You must be signed in to change notification settings - Fork 204
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
Crashes in parsetab due to ply race condition #206
Comments
jfly
added a commit
to jfly/flanker
that referenced
this issue
Sep 30, 2018
This fixes mailgun#206. Before this change, when multiple Python processes are simultaneously doing a `from flanker.addresslib import address`, it's possible for some of them to crash in `ply` code. See dabeaz/ply#184, where I attempted to work around this issue by changing ply. You can see in this comment: dabeaz/ply#184 (comment) that the author of ply suggests to workarounds for this issue: 1. Remove `ply` as a dependency in setup.py and copy the source code of `ply` into `flanker`. 2. Disable writing parsetab files to disk when invoking `yacc`. 2) seemed like the simpler solution to me, so that's what I've done here.
jfly
added a commit
to jfly/flanker
that referenced
this issue
Sep 30, 2018
This fixes mailgun#206. Before this change, when multiple Python processes are simultaneously doing a `from flanker.addresslib import address`, it's possible for some of them to crash in `ply` code. See dabeaz/ply#184, where I attempted to work around this issue by changing ply. You can see in this comment: dabeaz/ply#184 (comment) that the author of ply suggests to workarounds for this issue: 1. Remove `ply` as a dependency in setup.py and copy the source code of `ply` into `flanker`. 2. Disable writing parsetab files to disk when invoking `yacc`. 2) seemed like the simpler solution to me, so that's what I've done here.
jfly
added a commit
to jfly/flanker
that referenced
this issue
Mar 21, 2019
This fixes mailgun#206. Before this change, when multiple Python processes are simultaneously doing a `from flanker.addresslib import address`, it's possible for some of them to crash in `ply` code. See dabeaz/ply#184, where I attempted to work around this issue by changing ply. You can see in this comment: dabeaz/ply#184 (comment) that the author of ply suggests two workarounds for this issue: 1. Remove `ply` as a dependency in setup.py and copy the source code of `ply` into `flanker`. 2. Disable writing parsetab files to disk when invoking `yacc`. 2) seemed like the simpler solution to me, so that's what I've done here.
My PR to |
@thrawn01, I see you've made a change to this repo in the last year. I'd appreciate some input here, we're still dealing with (working around) this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When multiple Python processes are simultaneously doing a
from flanker.addresslib import address
, it's possible for some of them to crash inply
code. I can fairly reliably reproduce this crash with the following dockerfile:This bug has been reported before in #168, and PR #188 attempted to work around the issue. However, the workaround in that PR doesn't help if you have a different version of ply installed than flanker used to generate its parsetab files. ply will notice that the parsetab files were generated with a different version of flanker, and decide to regenerate the files, causing the same bug. As I understand it, there are two ways flanker could work around this issue:
ply
to exactly version3.10
(this is the version used in Dont always regenerate parsetab #188). This was actually discussed here: Dont always regenerate parsetab #188 (comment), but rejected (I don't think the people involved in that discussion were aware of the race condition).yacc
to passwrite_tables=False
, as @jlev did in spacedogXYZ@54d5008.However, I would argue that neither of these are great solutions, and they are just working around a fundamental race condition in ply. I've sent in a PR to ply to try to fix the root bug (dabeaz/ply#184), but I wanted to file this issue with you guys just so you're aware of it. Currently, it's pretty unfortunate that someone who does
pip install flanker
will automatically end up withply == 3.11
, and be exposed to this race condition.The text was updated successfully, but these errors were encountered: