Skip to content

RecursionError in SimpleLogRecordProcessor after shutdown method being called #3625

@OS-joaocastilho

Description

@OS-joaocastilho

Describe your environment
Python version: 3.10

Steps to reproduce

  • Initialize an instance of the SimpleLogRecordProcessor class.
  • Execute an action that call the shutdown method on the processor instance.
  • Emit a log after the shutdown method has been called.

What is the expected behavior?
The SimpleLogRecordProcessor should gracefully handle the log emission after the shutdown method has been called and not generate a RecursionError.

What is the actual behavior?
The class generates a RecursionError due to the warning logic in the emit method, creating a recursion loop when another log is emitted after the shutdown method is being called.

Additional context
Comparing this behavior with the BatchLogRecordProcessor, it handles the scenario differently, it just returns and do not raise any warning, avoiding the RecursionError. The SimpleLogRecordProcessor should adopt a similar approach and not raise warnings to prevent the recursion loop and associated error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingloggingsdkAffects the SDK package.

    Type

    No type

    Projects

    Status

    Done

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions