Hello,
I'm currently testing Iron.io push queues for some long running (2-3 minutes) jobs. I've noticed a strange behavior with jobs that run several minutes. I see them being run multiple times. I did some reading and found this behavior that Iron.io is aware about for jobs running longer than 60s.
http://dev.iron.io/mq/reference/push_queues/#long_running_processes__aka_202s
Long Running Processes - aka 202
If you'd like to take some time to process a message, more than the 60 second timeout, you must respond with HTTP status code 202. Be sure to set the "timeout" value when posting your message to the maximum amount of time you'd like your processing to take. If you do not explicitly delete the message before the "timeout" has passed, the message will be retried. To delete the message, check the "Iron-Subscriber-Message-Url" header and send a DELETE request to that URL.
I believe my longer jobs are being retried once they hit the 60s timeout.
Does anyone have a suggestion on how I could get this to work? Almost seems like I should try deleting the job from the queue even before it has finished running.
Thanks, Jay
The first thing you could try is just increasing the timeout when posting the job onto the queue. But yes, Iron wants you to delete job before it is done. That only becomes a problem if you think the job could fail afterwards.
Thanks @andrewryno. I did just that. I couldn't find an easy way to pass in the timeout, so I submitted a pull request to add that functionality in. Fixes the issue for me, no more multiple jobs showing up.
https://github.com/laravel/framework/pull/3555
Hopefully they include the changes as I found someone else having the same issue with long running jobs.
Jay
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community