fshutdown / JMeter-WebSocketSampler

JMeter - WebSocket Sampler
Apache License 2.0
312 stars 191 forks source link

[1006] WebSocket Read EOF on Close connection pattern #59

Open enflout opened 8 years ago

enflout commented 8 years ago

I have set Close connection pattern as:

Response pattern: NOT_A_CHANCE_TO_CONTINUE_CLOSE_CONNECTION Close connection pattern: .*

Is is okay but in multi-thread environment sometimes I get an error in Sampler result:

I have found this code in project:

@OnWebSocketClose
public void onClose(int statusCode, String reason) {
    if (statusCode != 1000) {
        log.error("Disconnect " + statusCode + ": " + reason);
        logMessage.append(" - WebSocket conection closed unexpectedly by the server: [").append(statusCode).append("] ").append(reason).append("\n");
        error = statusCode;
    } else {
        logMessage.append(" - WebSocket conection has been successfully closed by the server").append("\n");
        log.debug("Disconnect " + statusCode + ": " + reason);
    }

    //Notify connection opening and closing latches of the closed connection
    openLatch.countDown();
    closeLatch.countDown();
    connected = false;
}

I have read about 1006 Close Code:

1006

  1006 is a reserved value and MUST NOT be set as a status code in a
  Close control frame by an endpoint.  It is designated for use in
  applications expecting a status code to indicate that the
  connection was closed abnormally, e.g., without sending or
  receiving a Close control frame.

https://tools.ietf.org/html/rfc6455#section-7.4.1

And I have no idea how to diagnose the underlying reason of this exception.