Skip to content
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

RACK_TIMEOUT_TERM_ON_TIMEOUT=0 still does not allow TruffleRuby to run #211

Open
sempervictus opened this issue Nov 24, 2023 · 2 comments
Open

Comments

@sempervictus
Copy link

sempervictus commented Nov 24, 2023

Getting

Current Runtime does not support processes
/build/openprojectv/src/openproject/vendor/bundle/truffleruby/3.2.2.23.1.0/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:78:in `initialize'

when invoking RACK_TIMEOUT_TERM_ON_TIMEOUT=0 RAILS_ENV=production bundle exec rake db:migrate db:schema:dump db:schema:cache:dump with TruffleRuby (JVM version) 23.1.1.
Trying to hack around it currently with sed -e 's/@term_on_timeout =.*/@term_on_timeout = ::RUBY_ENGINE == "truffleruby" ? false : read_timeout_property(term_on_timeout, ENV.fetch("RACK_TIMEOUT_TERM_ON_TIMEOUT", 0).to_i)/' lib/rack/timeout/core.rb but it seems like either the ENV var is being overridden or term_on_timeout is already true somehow.

@wuputah
Copy link
Collaborator

wuputah commented May 20, 2024

Can you please share your use (or insert_before) statement?

The environment variables will not override setting a value at initialization time. If you want to be able to toggle a setting on/off using environment variables, you must always use environment variables. The alternative is to handle it yourself to have the effect you desire.

use Rack::Timeout, term_timeout: ENV['RACK_TIMEOUT_TERM_ON_TIMEOUT'] || 15

In this case, it will prefer to use the ENV var since it's being explicitly passed in, but default to 15 if it is unset.

Otherwise, this appears to be a bug in TruffleRuby. (Arguably, it already is, since the error you provided is not being printed by rack-timeout, and rack-timeout only attempts to run ::Process.respond_to?(:fork), which should be able to return false in TruffleRuby rather than raising an error. If there is some more canonical way to check this, I'm all ears.)

@wuputah
Copy link
Collaborator

wuputah commented May 20, 2024

Ah, sorry, this error was raised by rack-timeout; the error message was changed on HEAD in this commit 0f35a85 which misled me here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants