Open evanlok opened 6 months ago
Hi @evanlok
Apologies for the delay in response, and thanks for your patience.
In order for us to investigate this further, can you please confirm whether our understanding of what you are doing in the example is correct?
Foo
instanceFoo
to_s
on itPlease elaborate on anything here that may not be exactly correct.
Yes, that is correct.
Hi @evanlok
Can you please elaborate on why you are making a database query in to_s
? We generally wouldn't recommend making a database call in such a way as to_s
is a standard method in Ruby used to cast the thing you're looking at to a string representation. You wouldn't really expect this to do anything other than represent the in-memory object.
The to_s
method was querying for related configuration to determine the string output. We removed the database call from the method to resolve the issue but it's possible this can happen again in the future. It was quite difficult to debug initially so if there's a way bugsnag can prevent or warn when this occurs it would be helpful.
Hi @evanlok
Thanks for your patience on this.
We now have a task on our backlog to discuss and explore our options here when priorities allow. I can't currently provide an ETA on when this could be looked at, but we will make sure to post any further updates on this thread regarding future discussions or developments on this.
Describe the bug
Bugsnag's delivery thread can checkout an ActiveRecord database connection that is never returned to the pool. This causes subsequent connections to time out waiting for a connection from the pool.
Steps to reproduce
to_s
which is called when it gets serialized by bugsnag. Theto_s
method contains code that queries the database.to_s
method is invoked byBugsnag::Cleaner#traverse_object
Environment
Example code snippet
Error messages:
``` ```