Closed egze closed 2 years ago
IIRC this is a poolboy quirk that has to do with monitoring processes that have timed out. Machine Gun (which also uses poolboy) has the same issue and has a note at the bottom of the readme about using it in GenServer processes.
It's not a Poolboy quirk per se. It happens in certain cases when a calling process makes a request that hits the timeout period. The caller stops listening for a message and moves past the call to Mojito.request
. But because this takes place in a distributed system, it is possible for this to happen when the response has actually arrived, which results in a Mojito response message being sent to a caller process that is no longer waiting for it. When that caller process is a GenServer, the message will end up being handled by the handle_info
callback.
It may be possible to cut down on the number of times this occurs by sending a "hangup" message from the caller to the Mojito connserver when a timeout occurs, essentially doubling the number of race conditions that need to be met for a spurious emission, but I don't know of a lightweight way to solve it completely.
Hi! This project is now deprecated:
We recommend that you use Finch which is also built on Mint. The creator of Finch has an excellent writeup here describing the problems with Mojito, and as a result we use Finch internally at Appcues now.
We have a GenServer that is polling a webservice with Mojito. Constantly the genserver process is receiving messages like:
We ignore them like so:
But I think this is a bug. Why is the caller process receiving these messages in the first place? I think these messages come back after Mojito already returned a timeout error, but not sure.