-
Notifications
You must be signed in to change notification settings - Fork 109
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
ObjectDisposedException is thrown after restarting Hangfire #112
Comments
Hello @hankovich. Were you able to resolve this issue? |
Nope. Moreover, after updating to .NET 6, we found an insane increase in latency (up to 1 minute and even more). Don't know if it's a problem with the Hangfire itself, with StackExchange.Redis or with Hangfire.Redis.StackExchange |
The increase in latency is interesting, I suspect the exact latency is 3 minutes, which is the allowed max time to wait for a new notification from Redis pub/sub to arrive. |
Well, the problem with insane increase of latency which I mentioned here (#112 (comment)) was not caused by public IDatabase GetDatabase(int db = -1, object? asyncState = null) =>
_connectionMultiplexer
.GetDatabase(db, asyncState)
.WithKeyPrefix(_prefix); // build-in in StackEcxhange.Redis And it appeared that a wrapped instance from But the original problem still exists. After restaring |
I don't know " |
hi,I met the same error too. and found the RedisSubscription's execute method is the issue point. Because the hangfire storage is a single pattern, and RedisSubscription is only init once in RedisStorage ctor. so when restart the hangfire server maunal or the code can't connect to the redis till the error time exceed the BackgroundJobServerOptions'ServerTimeout the hangfireserver will auto restart,then the heartcheckprocess will send the CancellationRequested so the mre will be disposed ,but the Storage will not be reinited because it is a single pattern.you can found this code in HangfireServiceCollectionExtensions |
I see a lot of
ObjectDisposedException
in my logs after restarting Hangfire server likeWhile they do not block the execution of scheduled jobs, they increase
latency
dramatically (from a couple of milliseconds to 3-5 seconds).The text was updated successfully, but these errors were encountered: