0

I'm running a Java based system on CentOs and I sometimes see that clients of a service experience "Connection refused" errors for short periods. The interesting is that the server is, at the same time, serving requests. The error is intermittent.

Is it possible that the listener socket's backlog fills up for a short time and it causes new requests to be refused? I'm running out of clues and I wasn't able to reproduce this outside the continuous integration system so far.

allprog
  • 141
  • 1
  • 4

1 Answers1

1

I think your guess is correct, man listen(2) says (emphasis is mine):

The backlog argument defines the maximum length to which the queue of pending connections for sockfd may grow. If a connection request arrives when the queue is full, the client may receive an error with an indication of ECONNREFUSED or, if the underlying protocol supports retransmission, the request may be ignored so that a later reattempt at connection succeeds.

foo
  • 170
  • 8
  • Yes, this is what I found, as well. But I wasn't able to artificially reproduce it. Do you have any idea how this could be done? I tried this: https://gist.github.com/andrask/d2d14cc0d2b6ee3d3076 But it never gets refuse or timeout or anything. It always succeeds. – allprog Dec 09 '15 at 09:29