-
Notifications
You must be signed in to change notification settings - Fork 583
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
make it work with ruby 3.1 by upgrading thin to the latest version … #496
Changes from all commits
eb03fdf
f1e379d
c17f876
74f97dd
f71d348
9140a60
95872aa
4c07d57
b8197d1
a122c04
13294a0
544578c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,8 @@ Gem::Specification.new do |s| | |
"views/**/*", | ||
] - Dir["lib/mail_catcher/web/assets.rb"] | ||
s.require_paths = ["lib"] | ||
s.executables = ["mailcatcher", "catchmail"] | ||
s.extra_rdoc_files = ["README.md", "LICENSE"] | ||
s.executables = %w[mailcatcher catchmail] | ||
s.extra_rdoc_files = %w[README.md LICENSE] | ||
|
||
s.required_ruby_version = ">= 2.6.0" | ||
|
||
|
@@ -37,8 +37,10 @@ Gem::Specification.new do |s| | |
s.add_dependency "rack", "~> 1.5" | ||
s.add_dependency "sinatra", "~> 1.2" | ||
s.add_dependency "sqlite3", "~> 1.3" | ||
s.add_dependency "thin", "~> 1.5.0" | ||
s.add_dependency "skinny", "~> 0.2.3" | ||
s.add_dependency "thin", "~> 1.8.0" | ||
s.add_dependency "net-smtp", "~> 0.3.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was net-smtp added here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ref: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As already mentioned by @tagliala, as of Ruby 3.1, net-smtp was moved to bundled gems. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see. Thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This now spits a lot of warnings during startup for me on Ruby 2.7.5:
If it's loading stdlib and the gem, that might cause issues? How does one avoid this double loading on older rubies? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried ruby 2.7.5 and I'm getting same warnings. Not sure how to avoid that yet, will keep looking for a solution. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following this issue: ruby/net-imap#16 , adding net-http as dependency solves "already initialized constant" issues with net-protocol. |
||
s.add_dependency "net-http", "~> 0.2.0" | ||
s.add_dependency "faye-websocket", "~> 0.11.1" | ||
|
||
s.add_development_dependency "capybara" | ||
s.add_development_dependency "capybara-screenshot" | ||
|
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.
I think EventMachine should already be quitting cleanly. But, if not, I think for this line you want:
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.
You're right. The magic was to pass signals: false to thin.
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.
But now thin doesn't exit cleanly?
Sorry, by "EventMachine should already be quitting cleanly" I meant that thin's signal handler is enough to shut down the reactor including draining thin's connections cleanly. Did that break? Is that why you made this change initially?
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.
Ctrl+C now does this for me:
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.
My initial motivation for this was the fact, that for me on MacOS 12.1 (Intel) CTRL+C / SIGINT did nothing and mailcatcher process can only be stopped with SIGKILL.
Passing "signals: false" to thin makes SIGINT work, but as you state above also prints stacktrace. Explicitely trapping INT signal in the eventmachine loop makes it exit cleanly.
BTW, your suggestion to use "EventMachine.next_tick" leads to following error:
eventmachine.rb:1117:in "synchronize": can't be called from trap context (ThreadError)