Closed mavient closed 11 months ago
I will look into this, thanks for the report
Can you share more info on this, mainly I'd like to know the following:
I was not able to reproduce a stall, but due to the way Autotest works, litemetric detects an exit before the tests run, so we end up with a set of closed statements and a closed connection. This is remedied by creating the connection inside the setup method of the test class so it is triggered after the process is forked.
Do you have the metrics enabled?
I don't have metrics enabled, would it be helpful to enable them?
Are you doing that within a test framework? if so, are you setting up the AR connection in the setup method? or globally?
No this was within production.
Can you share the full test/source file?
I'll work on creating a sample rails app with it.
Don't enable metrics for now, let's limit the number of variables.
I will be waiting for the sample app
I didn't realize you need to set config.active_support.isolation_level = :fiber
in order for activerecord to be fiber safe. Going to close this out.
So using rails 7.1.1 and activerecord with litedb and running this:
Seems to stall after the first iteration of the loop, I've tried the other batch operators and they also stall. I'm not really sure what to make of this as it seems like it should work.