-
Notifications
You must be signed in to change notification settings - Fork 84
Conversation
@diadistis thank you for the PR and I'm sorry this is causing you problems. I'm actually 👎 on this as I think switching from From the pastebin, I can determine you are running ChefDK with embedded Ruby 2.0.0. I couldn't find an upstream bug about this on bugs.ruby-lang.org, but that doesn't mean it doesn't exist 😄. I haven't been keeping up with ChefDK releases, but perhaps you could try upgrading to the latest version? An upgraded Ruby version may fix this issue. @danielsdeleo @sersut has anyone else reported an issue like this? It's definitely a weird one to me... |
@sethvargo thanks for the feedback. Yes there are others who seem to have the same problem. It maybe a version/platform combination. I will look further into it. |
@diadistis well I've upvoted and tweeted your Stackoverflow post because I'm also curious. The |
@sethvargo thanks. I have tested it again and again. It does make a difference in my setup. I will try to recreate the problem with a simpler ruby script. |
I haven't seen any other reports like this on the ChefDK issues, Chef mailing list, etc., sorry. This is very bizarre, as the only documented difference between the two block syntaxes is the precedence (as @sethvargo says), which should only make a difference if you are using so-called "Seattle Style" ruby (never use parens unless absolutely required). For a wild guess, if this code is run in threads, perhaps one style allows ruby to context switch to a new thread and the other doesn't? Could this be a very bizarre symptom of an underlying race condition? |
This is almost certainly a race condition in the language's implementation. Pretty such a shot in the dark (and this needs more investigation), but the issue seems to arise here:
The curly-brace vs. |
I think it's important to note that everybody encountering this issue (Including myself) is running ChefDK on Windows, so this feels like it may be a platform-specific issue in addition to what @skottler found above. |
@xenolinguist can you please check if my patch works for you too? |
+1 - seeing it intermittently on Windows 7 here. Same stack trace. |
I'm going to go ahead and accept this no matter how bizzare it sounds. |
This fixes the following error :
Details about the problem can be found in this SO question