Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid stack overflow when disposing batched sink #134

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

nblumhardt
Copy link
Contributor

Fixes #133

The normal chain of disposal when using PeriodicBatchingSink is LoggerPeriodicBatchingSink(IDisposable)IBatchedLogEventSink. The sink added to the logging pipeline is a PeriodicBatchingSink instance, and the batched sink isn't normally exposed.

Because CloudWatchLogSink is a public type in this project, in #111 I intended to keep the API as compatible as possible and made the sink and batched sink the same type - CloudWatchLogSink. This led to the aforementioned bug.

This PR switches to the new scheme, but keeps CloudWatchLogSink as a backwards-compatible adapter.

Copy link
Collaborator

@wparad wparad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small things and then we can go and merge this in.

@nblumhardt
Copy link
Contributor Author

Done - thanks for the review.

@wparad wparad merged commit 700e588 into Cimpress-MCP:master Apr 2, 2024
1 check passed
@wparad
Copy link
Collaborator

wparad commented Apr 2, 2024

Thank you for helping to fix this. Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StackOverflow on shutdown due to infinite loop with PeriodicBatching changes
2 participants