-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeout if the broker handling client request is shut down #20
Comments
Zeromq allows clients to use multiple brokers in the Smsense that if a client sends multiple requests, these are ventilated to brokers with a round robin logic. Otherwise you will have duplication. Right now the retry in case of timeout is left to the user that can handle resubmit the request again in case of timeout. However we can do it automatically adding an option to the request that forces client to retry sending it. Sounds good? |
Would help me as well. As you just said, i'm doing it manually with a requests interface. |
Seems like zeromq is not meant to provide this kind of security, right? |
Zeromq is a socket layer basically so you can use the available patterns to create what you need. |
@prdn It seem to be good, but for a task we will not be able to know if client failed or did the broker. Eg. If there is any write command issued to worker (and after request reached to worker, if broker goes down), and worker finished the write, If we retry sending by setting in client, then there will be multiple writes right? Which is a big problem. |
Yes that's true. The client retry will be optional and disabled by default. So you can use in a scenario where you a duplicate requests doesn't affect your system. Think about a query for some data. It would be helpful to resubmit the request automatically in case of timeout with a limit of attempts. In more delicate scenarios you should handle the timeout manually so you can check before resend. Have I answered your question? |
Yes, Thanks. But, Will not it be good if PIGATO support adding multiple broker to worker, so that worker can send response to any available or in anyway do that. (as an enhancement ) |
That's not easy to do this unless a client sends the same request to multiple brokers. Because a broker needs to route the response back to the client. |
I guess you are right, but I don't understand how will that be against scalability pattern. Because in my opinion if broker knows another broker's socket, it can just ping (or send heart beat). |
Yes but it may happen that broker for any reason fail to synchronise. What would happen if they are in charge both to forward the same request to an available worker? |
The message could contain the data necessary to reply to the client. |
A use-case can be,
|
In this case, all clients must always be connected to all brokers, right? Is it bad? |
Clients may not be aware of all available brokers. A solution could be introduce routing solution for failed deliveries. |
@prdn This seems like a logical solution but not something that should be implemented in the Client/Broker/Worker core. This would allow us to keep the core clean and usable even when plugins are provided by third party's |
I can't see much where to fit some plugins pattern, maybe emitting some events to the worker and the client, so it would be easy and possible to take actions from the client when, for example, a message delivery to the worker failed. Those kinds of messages could broadcast to all brokers, so one of them could delivers it to the client (if needed, like a broker went down) |
Take a look here #21 Special Workers will be deployed in external projects (i.e pigato-mapreduce) |
@prdn If not, Don't you think it will be good to have? |
@rbnacharya No currently there are only the error event fired. I have been looking at adding client/worker join to the broker as its something we require. There is nothing stopping extra event being added and its straight forward to do with minimal effort |
I implemented PIGATO with following architecture,
I placed 2 brokers and 2 workers
broker 1 - have registered 2 workers
broker 2 - have registered 2 workers
Client use both the broker, and when we request it just go through any one,
and, if I stopped the broker that is handling request then client will receive timeout, and is not redirected to other broker.
(this seem to be message get lost)
Is there any way to distinguish this timeout from timeout when client fails (or client didn't send the response? )
The text was updated successfully, but these errors were encountered: