Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have multiple cron jobs in an application but recently noticed a job has been stopping suspiciously in-between with error "processing server takes too long to shutdown. performing ungraceful shutdown". In some cases, within a few seconds.

What I have tried:

# Updated to the latest version
# Extended default timeout to 1 hour
Posted
Updated 21-Jul-20 3:43am
Comments
Richard MacCutchan 21-Jul-20 9:01am    
What job, what is it doing, where does the message come from, etc.? Please use the Improve question link above and add some proper details to your question.

1 solution

Seems you are referring and using:

Hangfire[^]

C#
public void Dispose()
        {
            SendStop();

            // TODO: Dispose _cts

            if (!_bootstrapTask.Wait(_options.ShutdownTimeout))
            {
                Logger.Warn("Processing server takes too long to shutdown. Performing ungraceful shutdown.");
            }
        }

With above, your server shutdown is taking time more than configured. You should look into that on what holding to it. Most probably some thread is still actively doing some work.

You need to also assess on why Dispose is being called in case that was not intended to. You need to debug it to figure out.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900