itamarst / eliot

Eliot: the logging system that tells you *why* it happened
https://eliot.readthedocs.io
Apache License 2.0
1.09k stars 65 forks source link

Prevent infinite recursion from broken destination when inside action #477

Closed alextatarinov closed 2 years ago

alextatarinov commented 2 years ago

Refs: https://github.com/itamarst/eliot/issues/476

As it turned out, adding try/except won't do the trick, since the exception is actually never raised. Instead, infinite recursion occurs, eating all CPU and RAM. This is the only idea I had to make it work without substantial changes. I am not fully aware of the consequences of adding action._logger = logger, but at least the tests seem to pass.

itamarst commented 2 years ago

I'm a little worried about this solution insofar as it mutates the action indefinitely, and the action may be used in later messages... So will see if I can figure out a different fix.

itamarst commented 2 years ago

Closing in favor of new PR, which will be based on this one.

alextatarinov commented 2 years ago

I'm a little worried about this solution insofar as it mutates the action indefinitely, and the action may be used in later messages... So will see if I can figure out a different fix.

You are right, haven't thought about it. Well, hope you'll find another way!

P.S. Can't we just return the old action._logger after emitting the error log?