CloseWebSocketSampler: Unhandled error; IllegalStateException: Cannot send pong frame when state is CLOSED_CLIENT

Issue #185 open
Former user created an issue

Java: openJDK 1.8; JMeter 4,0; plugin 1.2.8

Please check the attached mock-up scripts.

TestPlan-willThrowError.jmx - if the WebSocket Ping/Pong Frame Filter is set with global scope with setting to respond to ping, this will throw error pasted below on WebSocket Close. Description suggest that a pong is trying to be sent after connection was already closed.

TestPlan-works.jmx - if the WebSocket Ping/Pong Frame Filter for WebSocket Close (encapsulated in Transaction Controller) is set to filter but not to respond to ping it works (meaning no errors). In this case I moved the WebSocket Ping/Pong Frame Filter from being global to be included in each Transaction controller n with filter and respond to ping.

The full stack trace:

#!ERROR e.l.j.w.CloseWebSocketSampler: Unhandled error in sampler 'ws close'. java.lang.IllegalStateException: Cannot send pong frame when state is CLOSED_CLIENT at eu.luminis.websocket.WebSocketClient.sendPongFrame(WebSocketClient.java:361) ~[JMeterWebSocketSamplers-1.2.2.jar:?] at eu.luminis.jmeter.wssampler.PingFrameFilter.performReplyAction(PingFrameFilter.java:63) ~[JMeterWebSocketSamplers-1.2.2.jar:?] at eu.luminis.jmeter.wssampler.FrameFilter.receiveFrame(FrameFilter.java:76) ~[JMeterWebSocketSamplers-1.2.2.jar:?] at eu.luminis.jmeter.wssampler.FrameFilter.receiveFrame(FrameFilter.java:68) ~[JMeterWebSocketSamplers-1.2.2.jar:?] at eu.luminis.jmeter.wssampler.CloseWebSocketSampler.doSample(CloseWebSocketSampler.java:60) ~[JMeterWebSocketSamplers-1.2.2.jar:?] at eu.luminis.jmeter.wssampler.WebsocketSampler.sample(WebsocketSampler.java:169) [JMeterWebSocketSamplers-1.2.2.jar:?] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490) [ApacheJMeter_core.jar:4.0 r1823414] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416) [ApacheJMeter_core.jar:4.0 r1823414] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250) [ApacheJMeter_core.jar:4.0 r1823414] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222-2-ojdkbuild]

Question here is: even though there is a workaround that works for me. Would it be possible to have some fix that will allow WebSocket Close to work if the WebSocket Ping/Pong Frame Filter scope is global with setting to sent response to ping?

Thanks for a great work and supporting the plugin!

Comments (2)

  1. Log in to comment