I'm planning to implement checkpointing to react to AWS Spot interruptions (which send a `SIGTERM`) in a Symfony application. I already implemented a listener for `console.signal` to log occurrences of such events, and `SignalableCommandInterface` on a specific Symfony command to log progress at interruption time for that command, and I was wondering if there was a library I should know about or a blog post I should read before implementing the checkpoint logic itself. What do you recommend? 🙂

To clarify, I need to implement this in a very long cronjob, and by "checkpointing" I mean saving progress, and starting over from where I left off during the next invocation of the command.

Suivre

@greg0ire have you looked at how Messenger components works? It already provide a retry mechanism, maybe you can easily implement a partial retry based on it. I don't know the detail but the best should be to split the long job command with little atomic one too.

@Vimar I have considered it, but I'm not sure it's a great fit here: one of the commands taking time is already a RabbitMQ producer, and should not be run in parallel of itself. Also, if possible, I'd like to get rid of the interruption handling code if we move to something else than Spot instances and it turns out to be useless, so I'd like to make as few changes as possible in existing code, violating the OCP as little as possible.

Inscrivez-vous pour prendre part à la conversation
techlover

Technology lovers, here we are — (development, digital artwork, science…)