Skip to content

Create an easy way to kill all currently running message queue consumer processes #181

Open
@hostep

Description

@hostep

Hi folks

It would be great if we can have some easy way to stop all current message queue consumer processes running on the server.
We are having some problems in our deploy flow that old message queue consumer processes keep running using old code from memory even after new code has been deployed.
I know there is this new poison pill mechanism, where message queue consumer processes kill themselves if they notice some configuration has changed and if they have at least one new incoming message.

I would like to see something similar, where we can say to the message queues consumers that there is some new code deployed and they should stop themselves, in order to start up again using the new code.
The other problem is that this poison pill feature currently only kicks in after a new message was added to the queue. This could potentially take many week/months/years until this happens if a specific consumer is only used very infrequently. So that's not really ideal.

We are currently fixing it in our deploy flow, by finding all process id's in the var/ directory, and killing them one by one with the kill command.
But I don't know how safe that is to do if a message is currently being processed as we kill that process. I don't know if the message queue consumer system in Magento can deal with that in a nice way or not?

So if we would have an option to say via command line that message queue consumers should kill themselves, that would be really great I think.

A potential idea would be to have a command which changes the poison pill version in the database and also sends a single dummy message in all the consumer queues which does nothing except to indicate to the consumer that it should kill itself.

Thoughts, other ideas?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions