The Server was using a SynchrnousQueue to coordinate the main thread
and the background thread that receives the request from the client.
A SynchronousQueue only allows insertions when a corresponding call
to get is in progress. However, since the receiver thread is started
before the call to get, there was a short time window, where the call
to queue.offer could fail and simply return false. This return code
was ignored.
A possible solution would have been to call put instead of offer,
but I decided to replace the queue with a Future, since we only wait
for a single element.
Forward port of #1071
The Server was using a SynchrnousQueue to coordinate the main thread and the background thread that receives the request from the client. A SynchronousQueue only allows insertions when a corresponding call to
get
is in progress. However, since the receiver thread is started before the call toget
, there was a short time window, where the call toqueue.offer
could fail and simply returnfalse
. This return code was ignored.A possible solution would have been to call
put
instead ofoffer
, but I decided to replace the queue with a Future, since we only wait for a single element.