RFR [9] 8180155: WebSocket secure connection get stuck after onOpen

Daniel Fuchs daniel.fuchs at oracle.com
Wed May 31 11:13:52 UTC 2017


Hi Pavel,

Receiver.java:

  120     private void pushContinuously() {
  121         while (true) {
  122             if (!readable.get()) {
  123                 if (!initialized) {
  124                     initialized = true;
  125                     try {
  126                         channel.registerEvent(event);
  127                     } catch (IOException e) {
  128                         messageConsumer.onError(e);
  129                     }
  130                 }
  131                 break;
  132             } else if (demand.get() > 0 && !handler.isStopped()) {
  133                 pushOnce();
  134             } else {
  135                 break;
  136             }
  137         }
  138     }

I think you might have an issue here, if the initialBuffer
already contains all the data that there is to be read, then
the readable.get() will be false, initialized will be false,
pushOnce() will not be called, and you're going to register
an event that will never be triggered.

best regards,

-- daniel

On 31/05/2017 11:30, Pavel Rappo wrote:
> Hello,
> 
> Please review the following change:
> 
>   http://cr.openjdk.java.net/~prappo/8180155/webrev.00/
> 
> This change addresses 2 separate issues:
> 
>      https://bugs.openjdk.java.net/browse/JDK-8180155
>      https://bugs.openjdk.java.net/browse/JDK-8156518
> 
> The first one is a busy-wait for data on the socket which manifests itself as
> non-returning invocation of WebSocket.request(long).
> 
> The second one is an issue with a timeout for an asynchronous HTTP request.
> This issue affects both HttpClient and WebSocket implementations.
> 
> Thanks,
> -Pavel
> 



More information about the net-dev mailing list