[infinispan-dev] Hot Rod client sending data to itself - ISPN-8186

Dennis Reed dereed at redhat.com
Fri Aug 11 11:23:21 EDT 2017


On 08/11/2017 08:14 AM, Galder Zamarreño wrote:
> I've been looking at TRACE logs and what seems to happen is that is that sometimes, when the client needs to create a new Socket, it sends using the same localport as the Hot Rod server port. As a result, when the client sends something to the server, it also receives it, hence it ends finding a request instead of a response.

> What I'm not sure about is how to fix this... There are ways to potentially pass a specific localport to a Socket [2] but this could be a bit messy: It'd require us to generate a random local port and see if that works, making sure that's not the server port...

To fix that don't use an ephemeral port for the server.

> However, I think the real problem we're having here is the fact that both the server and client are bound to same IP address, 127.0.0.1. A simpler solution could be a way to get the server to be in a different IP address to the client, but what would that be that IP address and how to make sure it always works? Bind the server to eth0? 

You can't use a different IP for the client and server unless you have
two public IPs that can communicate with each other (not very common),
and explicitly set the client's IP.  That would be overkill just to work
around this particular issue.

Also note that it can only happen if the client is connecting to an
unused IP:port.  If the server is currently running on the port, it can't.

-Dennis


More information about the infinispan-dev mailing list