Hi there, I have a question regarding how background jobs work. I read the documentation but one part isnt clear for me.
If my background job code fails to execute successfully because it throws an exception (either because of an uncovered scenario or intentionally), does it stay in db as IsAbandoned=false? What turns IsAbandoned=true other than the 2 day timeouts?
In my case i have seen a job turning IsAbandoned=true in first try and i am trying to understand the logic behind it.
thank you
4 Answer(s)
-
0
Hi @uenlkr4e
The IsAbandoned field indicates that a job is no longer being run or tracked by the system. This can occur due to:
By default, if a job fails and is not completed within 2 days, it is marked as IsAbandoned = true and ignored by the system. When an error occurs during the process, the system checks the next time if it exists (by default it is 2 days) and tries the process again, but if the time value cannot be found, IsAbandoned is set to true.
If an error occurs while retrieving the type information of the job, it may be immediately marked as IsAbandoned = true. Related line
If a job cannot obtain the required lock and the system is unable to start the job, this may also result in IsAbandoned = true.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
So, say my job process runs and i call a remote service in it. The remote service does not respond at that moment and I want to keep the job in queue since i didnt get a response in my first try. What should I do here? Do i throw an exception?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @uenlkr4e
If the remote service you are calling does not respond and you want to put the job back in the queue to retry, you can throw an exception during the service call. When an error occurs during job execution, the system will automatically create retry attempts until the job times out. This process will continue until the timeout is reached. Related Document
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Perfect, thank you
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)