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

Execute retry logic in Send() method even if exception is not of type WebException #25

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

MikeMugu
Copy link

Hello,

We had an issue in production yesterday that caused our application to go offline on a couple of web servers for about a 1.5 minutes. During our investigation we found the following call stack:

Apr 24 14:59:12: Unhandled Exception: System.OperationCanceledException: The operation was canceled.
Apr 24 14:59:12: at System.Net.HttpWebRequest.GetResponse()
Apr 24 14:59:12: at log4net.loggly.LogglyClient.Send(ILogglyAppenderConfig config, String message)
Apr 24 14:59:12: at log4net.loggly.LogglyAsyncHandler.SendLogs()
Apr 24 14:59:12: at System.Threading.Thread.ThreadMain_ThreadStart()
Apr 24 14:59:12: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

It looks like the LogglyClient received an exception of type System.OperationCanceledException which is not handled in the Send() method so it crashed our process. This PR accounts for generic exceptions and executes the same retry logic. Applicable unit test has also been added.

…retry logic so as to not cause the client to crash during an unexpected exception.
@MikeMugu
Copy link
Author

Any response on this? Happened to us again, we can use our own fork but would rather not deviate.

@siseli
Copy link

siseli commented Aug 5, 2020

We had this bug too when using the loggly .net component.
Would be nice if it could be merged to master.

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.

2 participants