WebSocket I/O error: Software caused connection abort: socket write error OR end of stream

Issue #210 resolved
Chhavi Jain created an issue

My Thread Group consists of below samplers:

  • WebSocket Open Connection
  • Loop Controller to run for 110 times
  • WebSocket Write Sampler - sending a certain sort of data
  • WebSocket Read Sampler reading the stream of data returned by the server
  • Loop Forever

    • WebSocket Read Sampler -
    • Validate if a Ping is received in the response body of Read Sampler and send Pong in return

After running about 5~7 minutes, I get either of the two errors:

WebSocket I/O error: Software caused connection abort: socket write error

WebSocket I/O error: end of stream

I have run the same flow in Load Runner and it runs continuously for more than 2 hours however, in jmeter it fails in less than 10 mins. The application is continuously sending a stream of data and I can see that in the Read sampler however, still I am getting this error every time after it is run for more than 5 min.

Comments (5)

  1. Peter Doornbosch repo owner

    Can you make a WireShark capture and send (e.g. mail) it to me?

    Also, would be nice to check JMeter memory usage, e.g. connect JConsole or VisualVM, or configure gc logging (-Xloggc:gc.log) and check memory usage with gceasy.io.

  2. Chhavi Jain reporter

    Thanks for a quick response Peter.

    I have checked the Jmeter memory usage and it is very low, ranging between 100 ~ 300 MB. So memory doesn’t seem to be an issue here.

    I tried something different this time and this is what I observed.

    Note: My server is sending a continuous stream of data to the client.

    1. When I am reading the messages from the server using a read sampler every 30 sec and sending a pong only if there is a ping (Case 1) or sending a pong even when there is no ping (Case 2), I see that I am able to execute the test for more than 15 min without any failures in both the cases.
    2. When I am reading the messages from the server using a read sampler every 3 sec and sending a pong only if there is a ping, I see that I am not able to execute the test for more than 5 min and I receive a failure - Response code:Websocket I/O error
      Response message:WebSocket I/O error: end of stream

    I will have to check for the feasibility of sending a wireshark capture since there is a lot of client data involved. Meanwhile, please suggest if the above two experiments help you infer anything.

  3. Peter Doornbosch repo owner

    Well, it’s hard to tell what exactly is going on, but….

    It seems your server is closing the connection and it probably does it because the client is behaving in an unexpected way. This is a common problem / challenge when writing a test plan on protocol level (like with this plugin): in order to precisely simulate a real client, you either need to know all details of the protocol or base your test plan on a capture of the real thing. This is entirely similar to writing a testplan with the HTTP sampler where you need to mimic browser behaviour.

    Option 1 (know all details) can be done when the protocol is properly documented, e.g. when using STOMP. Option 2 (capture a real conversation and make your test plan simulate is) can be rather complex, depending on the nature of the protocol.

    Sometimes, people have issues with messages filling up the receive buffer; this is a condition that can be easily detected from a WireShark capture, that was why i was asking for it. Maybe you can check it your self: if you see message about “zero window” than this might be the problem.

    Hth,
    Regards
    Peter

  4. Log in to comment