IRC Log


Sunday December 26, 2010

[Time] NameMessage
[02:22] andrewvc cremes: around?
[08:42] neopallium how does one detect if a request sent to a REQ socket is lost? (i.e. the server dies/restarts before sending the message from it's REP socket)
[08:44] neopallium I have an example of a job queue server with worker clients, the workers connect a REQ socket to the server's XREP socket and pull for jobs, but if the server is restarted when the workers are waiting for a job, they get stuck.
[08:46] guido_g you can't
[08:47] guido_g or better, ømq can't, you've to build a timeout yourself
[08:55] neopallium one option I though of to try and solve this is to use PUB/SUB sockets so the server can tell the workers to re-connect. But I don't think that will be an option for other uses of REQ/REP sockets.
[08:57] guido_g right, req/rep is simple but doesn't work
[08:58] guido_g you have to augment it w/ poll for timeout
[20:52] andrewvc sustrik, cremes, I was wondering if either of you were around
[20:52] andrewvc or anyone who's done work with FDs lately, they seem to act funky for me
[20:52] andrewvc initially, they notify via 'select' properly, but after a point, they don't seem to
[20:52] andrewvc select(15, [12 14], [], [], {0, 90000}) = 1 (in [12], left {0, 89997})
[20:52] andrewvc select(15, [12 14], [], [], {0, 90000}) = 1 (in [12], left {0, 36581})
[20:53] andrewvc select(15, [12 14], [], [], {0, 90000}) = 0 (Timeout)
[20:53] andrewvc select(15, [12 14], [], [], {0, 90000}) = 0 (Timeout)
[20:53] andrewvc select(15, [12 14], [], [], {0, 90000}) = 0 (Timeout)
[20:53] andrewvc select(15, [12 14], [], [], {0, 90000}) = 0 (Timeout)
[20:53] andrewvc even with a constant stream of messages
[21:06] andrewvc oh, I'm not sure if this is true in general for select (or a total noob mistake), but previously I was reading a single message at a time off the socket whenever EM was notified by either select() or epoll(). This apparently does not work, your handler must repeatedly read off the socket until there is nothing left to read. I'm doing this by repeatedly checking ZMQ::EVENTS after reading each message.