-
Notifications
You must be signed in to change notification settings - Fork 65
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
requests hanging on aspnet webapplication #35
Comments
Hi @mapperr I think you are right. The method that checks if the collection to log to exists is still synchronous and it waits (for 30 sec) before failing. |
HI @mapperr I was thinking about the problem that you have reported to us but I can't imagine an elegant solution. If the database is down, it's quite normal that the logger tries for 30 seconds to connect to the database. In your opinion what would be the correct behaviour? |
Hi Emanuele, in the log4net FAQ https://logging.apache.org/log4net/release/faq.html is Gian Marco Gherardi On Wed, Feb 17, 2016 at 9:26 PM, Emanuele DelBono [email protected]
|
Hey, not sure if it's a covincidence but after I did some performance/fallback test also found this issue. The only alternative I can suggest right no is to add shorter timeouts in the connection string, like for 1s, e.g.:?waitQueueTimeoutMS=1000&socketTimeoutMS=1000&connectTimeoutMS=1000&serverSelectionTimeoutMS=1000 otherwise you'll need to override the appender and implement non blocking async tasks or something. |
I had a similar problem in application in the past. We were noticing that calls to our API were taking 30 seconds to complete. It was only by analysing the network traffic that we were able to find out that it was caused by us logging to a server that was not running. I had a quick try at using Task.Factory.StartNew( () => ..) to append to the logs but we'd have to rethink the unit tests. There is a Mongo command called serverStatus that may be able to help, but unfortunately it's not supported by the C# driver. |
Hi everyone,
we have a problem on our aspnet webapplication, in which we use mongodb only from the log4net mongodb appender.
if our instance of mongodb goes down (for whatever cause), the requests to our webapplication start to hang. if the mongodb instance goes up again, then the pending requests are fullfilled.
It's like the logging elaboration is on the request's thread, so if the appender cannot communicate with the mongodb instance, then the entire request waits (until a network timeout occurs).
Is that hypotesis correct?
If that's the case we would like to ask if it's possible to make the appender sort of "non-blocking": if there are problems with mongodb communication, the requests continue to be fullfilled.
That's the appender configuration from our web.config:
The text was updated successfully, but these errors were encountered: