-
Notifications
You must be signed in to change notification settings - Fork 19
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
Wrap application code in Rails executor to prevent autoloading problems #50
Conversation
Broadcasting happens from a thread and involves a `SolidCable::Message` model that is auto-reloaded by Rails in development. This can result in race conditions where the ActionCable thread tries to access the model class but it can't resolve it. https://guides.rubyonrails.org/threading_and_code_execution.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks.
3.0.3 is out and includes this fix @jorgemanrubia |
Wonderful, thanks @npezza93 🙏 |
Since upgrading to 3.0.3 I get an unresponsive Rails server in development the first time when I make any change in any template. Reading the changelog, I'm guessing this here is the issue 😅 These are the last logs I see:
I tried removing tailwind from Procfile.dev, but then there's just nothing in the logs, and the request is pending as before on the browser side. |
Hmm I can't reproduce that on my side 🤔. Could you share your development.rb, Rails version, @npezza93 Feel free to revert and release a new version while we troubleshoot. I have mixed feelings about waiting to see if we get more reports here, since a hanging dev server is pretty bad. Sorry about the trouble! |
Also, which db are you using @miharekar? |
I'm on rails 8.0.0, using PG for main db and sqlite for cable. Here are all the files, I'm more or less sticking with defaults.
|
I can't reproduce the deadlock on my side. @miharekar I'm curious, could you try to change this line in solid_cable locally to |
@jorgemanrubia @miharekar Looks like i can reproduce. Swapping executor for reloader seems to fix it for me. Ill cut a release |
Oh fantastic @npezza93, thanks a lot 🙏 |
Cut 3.0.4. Give it a shot and see if it crops up again |
Yup, seems fixed now. Thanks! 🙏 |
Broadcasting happens from a thread and involves a
SolidCable::Message
model that is auto-reloaded by Rails in development. This can result in race conditions where the ActionCable thread tries to access the model class but it can't resolve it.https://guides.rubyonrails.org/threading_and_code_execution.html