-
Notifications
You must be signed in to change notification settings - Fork 60
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
Writing hangs forever #314
Comments
Hi @maximeg, thanks for reporting this. I think this is perhaps fork. My guess is:
We have a possible fix for this in 8.11.3 (as yet unreleased). If you are OK with editing your homebrew vips.rb formula, you could try that. Alternatively, 8.11.3 ought to be out fairly soon. You can also work around this by disabling spring (which will stop the rails fork behaviour). |
Hi @jcupitt That is it :)
I use puma as a server, and it forks( If you want me to test 8.11.3, I will with homebrew. Tell me what to put in the |
It's a bit fiddly -- if disabling spring gets you going, I'd just wait. |
I'm having this error too – thought I was losing my mind until I found this issue! I can repro/fix the same way with How's the fix looking? Was this issue introduced in a recent version that I could roll back before? |
Yes, 8.11 has a new and faster threading system which starts up earlier in the libvips lifecycle. Rolling back to 8.10 should fix it, I think (or waiting for 8.11.3, or disabling fork. etc.) |
Just for future weary travelers, this was manifesting in our env as frozen tests. We run tests with parallelize turned on and tracking things down lead us to find it was VIPS causing the problem. Sure enough the problem goes away when you change the parallelize method to :threads so I think your theory about forking is correct @jcupitt, but that breaks a whole lot of other things like all system tests so not a solution. So for now we have to turn parallelize off on our dev machines until 8.11.3 comes out I guess? Luckily our CI is still running 8.10.1. |
PS. @jcupitt when do you expect 8.11.3 to be released? |
Can't you split the tests into those that fork and have vips stubbed and those that use utilize vips with threads? |
For those who may not be super familiar with the Ruby ecosystem I feel it's important to point out that forking is a super common thing for both production (puma web server and others) and development (spring) and tests (concurrent test runners) so disabling it long-term is very far from ideal. Rolling back vips is very difficult with Homebrew also unfortunately. But it sounds like a fix is upcoming so looking forward to that and thanks! |
@wilg os correct, this is not a problem with some obscure use case in Ruby, it's fundamental. I believe it's only not creating havoc in prod for us because we're on 8.10 there, otherwise since we use Puma multithreading so it'd be a disaster. We won't be re-engineering our tests, we have loads that touch image processing and shouldn't be stubbed and would likely fail in thread mode anyway. It would be easier to replace Vips. For now, the simple but annoying workaround is to disable Spring and parallelization in dev until the fix is out. |
8.11.3 is out ow with (hopefully) a fix for this. Homebrew should update shortly. https://github.com/libvips/libvips/releases/tag/v8.11.3 Sorry for the inconvenience this has caused. |
Wow, you're awesome @jcupitt, definitely didn't want to complain about the project, just wanted to be sure people knew it wasn't a trivial testing edge case only affected |
Double plus 👍 for releasing that. I'm just starting to use |
Hopefully this is fixed, I'll close. Please reopen if it's still broken. |
Hi everyone, I encounter some problem when I use ruby-vips with puma multi-workers. Those lines appears in my console when I load a page from a Rails controller/view and a concurrent variant processing objc[34825]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[34825]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug. |
@kevynlebouille I think you might need this issue: #155 I'd check your libvips version. |
@jcupitt yep, I saw this issue but it seems quite old now. I'm using a fresh setup with : Mac OS : 11.6 |
This is a different issue though -- this one is about threading breaking after fork, and I think it's resolved. It looks like you've hit some kind of problem with Objective-C string init during a fork(), which might or might not be related to libvips. Could you move to #155, please? |
I moved to #155. Thank you |
Hi,
I've been encountering an issue with writing hanging forever. Nothing too special, it happened at first with the image processing pipeline of rails.
Vips is installed via Homebrew, on an up-to-date Mac Mini M1.
Gem version:
ruby-vips (2.1.2)
To reproduce, in
rails console
:Vips works in CLI:
Edit: Vips works in std
irb
:The text was updated successfully, but these errors were encountered: