-
-
Notifications
You must be signed in to change notification settings - Fork 922
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
IO#each_line hangs when its #2461
Comments
Works like in MRI on 9k. On 1.7.x it appears that both threads are trying to acquire the same lock. each_line probably locks once around the whole operation while the other thread attempts to lock it on entry to read. However IO#close should trigger blocking threads to wake up, as in 9k...even if they're inside a synchronized bit of code. May be possible to change the granularity of the locking or fix the interrupt. |
Correction: it is ChannelStream.getline that's synchronized and leading to the lock contention. So it's not locking around the whole loop, but it is locking while it waits for the next line. |
So it's a bit trickier to fix. The getline logic in 1.7 does not use any selector (just calls blocking read), so it doesn't have an easily-interruptible call (interrupting a blocking read on JVM closes that stream). This may be a problem too large to solve given the way 1.7's IO is implemented, especially given that 9k appears to do it right. |
Going to call this fixed for 9k. |
Thanks for looking into it :) |
No need to waste Travis's computers on these since I know I expect them to fail for now. And I'm not working on them as I'm putting #31 on hold for a bit. Also removing it from things to do for #47. JRuby has an IO bug at the moment, it's causing EventStream tests to lock up. jruby/jruby#2461 I could probably get around it by commenting them out, it's not for a case that I actually expect anyway. But 9k Fixes this anyway, so wait for that to be common. Rbx had a bug with how it was handling mass assignment. The "rest" variable on this line https://github.com/JoshCheek/seeing_is_believing/blob/2ddca5d42c693e3028d574dcb74bcc1f654b068c/lib/seeing_is_believing/binary/remove_annotations.rb#L79 is nil when thre is only one subarray. I had started to open a bug report, but realized m Rbx was a bit older. So was going to upgrade and see if its still there, maybe try and fix it. But I couldn't get it to install. Couldn't find llvm-config. I'm on an older OS (Lion) since everyone had issues going to Yosemite, and don't feel like going through the headache of upgrading just to get a newer llvm, just to get Rbx. Plus apparently Apple is now tracking a lot more data, and you have to run some Python script to turn it off or something, and IDK, this one is working sufficiently fine for me. Oh, but I wound up uninstalling Rbx while attempting to upgrade, so now I don't even have one that I can test against. I'll probably come back to these when I have more time and it takes less effort.
Script below hangs. I don't expect this behaviour, but I do test it to make sure it handles it gracefully, but it's locking up the test suite.
The text was updated successfully, but these errors were encountered: