-
Notifications
You must be signed in to change notification settings - Fork 11
How can I find out that the job ended with an error #17
Comments
Hi, currently, there is no centralized storage broker which allows you to check the job status by its ID. This can be added on either PHP or Golang end (more reliable I think). Can you describe the desired flow in more details so we can plan it properly? Our team has been requesting the same functionality and I want to make sure it's aligned. |
We are using https://aws.amazon.com/en/swf/faqs/ to run complex workflows, it is possible to implement a similar pattern (decider + worker) but it will require at least another data storage to keep the execution state. |
Swf similar pattern will be great, much more then i expected.
|
All the brokers included in jobs already implement ASKs, including RabbitMQ. What we currently lack is complex logic here (a.k.a. what to do when job already failed): https://github.com/spiral/jobs/blob/master/service.go#L308 This method will be invoked if the job fails after multiple attempts. I guess we can improve it in the future to automatically send the application the notice about the dead job and let it decide what to do next. It can even be PHP callback. Technically implementing something like SWF is very simple, we can push an event to the application after each job execution/failure and let your code to decide what to do next or update the state machine. I guess this is something we can drastically improve after the release and completion of documentation. |
Actually, all the job events are already available and can be used to implement a state machine. But on Golang end, we have to expose them to PHP as well. |
Hello.
How can I find out (or catch or log) that the job ended with an error.
The BaseTest check the same $this->assertNotEmpty($id); for both ("error job" and "success job")
I found an example in spiral/framework JobDispatcher.php:
Is this the only way to catch it? Any other ways to catch it in "producers" ?
The text was updated successfully, but these errors were encountered: