This is a follow up to How to use unixODBC SSO connection to Snowflake with Rails using externalbrowser authentication?.
We found that on Linux (AlmaLinux 9 and Ubuntu) during application boot up Rails 7.0.4 doesn't wait for socket accept to finish a SAML authentication, but immediately returns -1 EINTR (Interrupted system call). In my application AFAIK need to do this authentication during initialization. So my application doesn't work.
Putting the connection command in a place that gets executed after initialization the authentication process works fine. But then the model initialization doesn't work correctly as I don't use application_record but Sequel::Model like:
class Generalnote < Sequel::Model(DB[:spectra__notes__general_metadata])
self.set_primary_key :lake_batch_id
end
Code (incl. authentication during initialization) works fine under Windows, but for production it should run on a Linux system.
Is there a better place to do DB = Sequel.connect(... than application.rb to avoid the problem? Or is there anything one can do to configure Rails to make it work as is?
See How to use unixODBC SSO connection to Snowflake with Rails using externalbrowser authentication? for the way the problem was identified.