Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket unimplemented BINARY message handling can result in TEXT message delivery to fail #5193

Closed
flymoondust opened this issue Aug 24, 2020 · 28 comments · Fixed by #5208
Closed
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@flymoondust
Copy link

flymoondust commented Aug 24, 2020

Jetty version 9.4.27.v20200227 to 9.4.31

Java version

OS type/version

Description
When the websocket is established, the client always miss the first message from the server,then it work fine.
Following is the debug log:

> 0>>>er: produ...\x00\x00\x00\x00\x00\x00\x00} appBuffer=DirectByteBuffer@3e21f04e[p=0,l=38,c=18432,r=38]={<<<\x81\x11WebSocket_Data0_0\x81\x11WebSocket_Data1_0>>>er: produ...\x00\x00\x00\x00\x00\x00\x00}
2020-08-25 05:50:23,943 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 810] <fill f=38 uf=false SslConnection@2f4a5845::SocketChannelEndPoint@6941cde5{l=/10.185.156.20:34140,r=/10.185.156.20:26335,OPEN,fill=-,flush=-,to=8/300000}{io=0/0,kio=0,kro=1}->SslConnection@2f4a5845{NOT_HANDSHAKING,eio=134/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5b9cb2e1{l=/10.185.156.20:34140,r=/10.185.156.20:26335,OPEN,fill=-,flush=-,to=12/300000}=>WebSocketClientConnection@7331d542[s=ConnectionState@1e1126ad[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@6e3c6fd5[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@4fcbe19[ExtensionStack,s=START,c=0,len=7,f=null]]
2020-08-25 05:50:23,943 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 487] Filled 38 bytes - DirectByteBuffer@3e21f04e[p=0,l=38,c=18432,r=38]={<<<\x81\x11WebSocket_Data0_0\x81\x11WebSocket_Data1_0>>>er: produ...\x00\x00\x00\x00\x00\x00\x00}
2020-08-25 05:50:23,944 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@13691193[READING] getAction(DirectByteBuffer@3e21f04e[p=0,l=38,c=18432,r=38]={<<<\x81\x11WebSocket_Data0_0\x81\x11WebSocket_Data1_0>>>er: produ...\x00\x00\x00\x00\x00\x00\x00})
2020-08-25 05:50:23,944 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 452] ReadState Action: PARSE
2020-08-25 05:50:23,944 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 302] CLIENT Parsing 38 bytes
2020-08-25 05:50:23,944 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 322] CLIENT OpCode TEXT, fin=true rsv=...
2020-08-25 05:50:23,944 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 104] CLIENT Payload Length: 17 - Parser@4fcbe19[ExtensionStack,s=PAYLOAD_LEN,c=0,len=17,f=TEXT[len=0,fin=true,rsv=...,masked=false]]
2020-08-25 05:50:23,944 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 613] CLIENT Window: DirectByteBuffer@4b3fb0d[p=0,l=17,c=17,r=17]={<<<WebSocket_Data0_0>>>} 
2020-08-25 05:50:23,944 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 256] CLIENT Parsed Frame: TEXT[len=17,fin=true,rsv=...,masked=false]
2020-08-25 05:50:23,944 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 189] CLIENT Notify ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]
2020-08-25 05:50:23,945 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 92] incomingFrame(TEXT[len=17,fin=true,rsv=...,masked=false])
2020-08-25 05:50:23,945 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@13691193[READING] getAction(DirectByteBuffer@3e21f04e[p=19,l=38,c=18432,r=19]={\x81\x11**WebSock...Data0_0**<<<\x81\x11WebSocket_Data1_0>>>er: produ...\x00\x00\x00\x00\x00\x00\x00})
2020-08-25 05:50:23,945 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 452] ReadState Action: PARSE
2020-08-25 05:50:23,945 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 302] CLIENT Parsing 19 bytes
2020-08-25 05:50:23,945 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 322] CLIENT OpCode TEXT, fin=true rsv=...
2020-08-25 05:50:23,945 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 104] CLIENT Payload Length: 17 - Parser@4fcbe19[ExtensionStack,s=PAYLOAD_LEN,c=0,len=17,f=TEXT[len=0,fin=true,rsv=...,masked=false]]
2020-08-25 05:50:23,945 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 613] CLIENT Window: DirectByteBuffer@5c2b4551[p=0,l=17,c=17,r=17]={<<<**WebSocket_Data1_0**>>>}
2020-08-25 05:50:23,945 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 256] CLIENT Parsed Frame: TEXT[len=17,fin=true,rsv=...,masked=false]
2020-08-25 05:50:23,946 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.Parser 189] CLIENT Notify ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]
2020-08-25 05:50:23,946 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 92] incomingFrame(TEXT[len=17,fin=true,rsv=...,masked=false])
2020-08-25 05:50:23,947 WARN  [HttpClient@51913b48-72][ROOT][com.huawei.ies.restconnectorservice.connection.**IESWebSocketClnt$WebSocketEventHandler** 332] start onMessage()!!!,sessionId=436151f0-663f-4de1-9171-708c4881716f,Get message from wss://10.185.156.20:26335/wss/sbirestgwtestservice/v1/websocket,message: ******. WebSocket_Data1_0
2020-08-25 05:50:23,947 WARN  [https-jsse-nio-127.0.0.1-31827-exec-3-12d3b571a4634ab0][ROOT][com.huawei.ies.restconnectorservice.connection.IESWebSocketClntManager 739] addWebsocketInfo() write into Redis. sessionId: 436151f0-663f-4de1-9171-708c4881716f, businessId: null, typeIdMap: {370a0f41-fcf3-4481-aa37-35b94bd6f6c10=null}.
2020-08-25 05:50:23,948 WARN  [HttpClient@51913b48-72][ROOT][com.huawei.ies.restconnectorservice.connection.notify.service.MsgQueue 64] successful add message to sessionId 436151f0-663f-4de1-9171-708c4881716f.
2020-08-25 05:50:23,948 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@13691193[READING] getAction(DirectByteBuffer@3e21f04e[p=38,l=38,c=18432,r=0]={\x81\x11WebSock...Data1_0<<<>>>er: produ...\x00\x00\x00\x00\x00\x00\x00})
2020-08-25 05:50:23,948 DEBUG [HttpClient@51913b48-72][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 452] ReadState Action: FILL
@flymoondust
Copy link
Author

WebSock...Data0_0 is the first message, WebSocket_Data1_0 is the second message, IESWebSocketClnt$WebSocketEventHandler is the client that complete @websocket

@flymoondust
Copy link
Author

9.4.19.v20190610 is fine, so i suspect it may be some bugs in the new versions.

@flymoondust
Copy link
Author

flymoondust commented Aug 24, 2020

I‘m lost now,because I find this bug occur when the server is netty, but not occur in tomcat server.

@lachlan-roberts
Copy link
Contributor

I can't see anything strange going on in that debug log, the first frame with WebSocket_Data0_0 is being parsed and given to the AbstractEventDriver. More information about your setup will help us debug what is happening.

Are you using the Javax or the Jetty websocket API?
Is your websocket endpoint annotated or implementing the listener interface?
What type of onMessage method are you using to receive the TEXT frames?

@lachlan-roberts lachlan-roberts self-assigned this Aug 24, 2020
@flymoondust
Copy link
Author

flymoondust commented Aug 25, 2020

import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.UpgradeException;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketFrame;
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage;
import org.eclipse.jetty.websocket.api.annotations.WebSocket;
import org.eclipse.jetty.websocket.api.extensions.Frame;
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.eclipse.jetty.websocket.common.LogicalConnection;
import org.eclipse.jetty.websocket.common.WebSocketSession;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;


public class IESWebSocketClnt {
    private static final SouthLog LOGGER = SouthLogFactory.getLogger(IESWebSocketClnt.class);

    public static final int WEBSOCKET_TIMEOUT = 15;

    private WebSocketClient webSocketClient;

    private Session session;

    LogicalConnection connection;

    private WebSocketSender wsSender;

    private String wsUrl;

    private WebSocketEventHandler handler;

    private ClientUpgradeRequest request;

    private String sessionId;

    private RedisData redisData;

    private String basicLogInfo = null;

    private int statusCode = WebSocketUtil.SWITCHING_PROTOCOLS;

    private boolean openWebsocketFlag = false;

    public IESWebSocketClnt(String wsUrl, WebSocketClient client, String sessionId) {
        this(wsUrl, client, sessionId, new ClientUpgradeRequest());
    }

    public IESWebSocketClnt(String wsUrl, WebSocketClient client, String sessionId, ClientUpgradeRequest request) {
        this.sessionId = sessionId;
        this.webSocketClient = client;

        this.wsUrl = wsUrl;

        this.request = request;
        this.handler = new WebSocketEventHandler();
        this.basicLogInfo = "start onMessage()!!!,sessionId=" + sessionId + ",Get message from " + wsUrl
            + ",message: ******";

        this.open();
    }

    public void disConnection(int status, String reason) {
        if (session != null) {
            if (session.isOpen()) {
                session.close(status, reason);
                if (connection != null) {
                    connection.disconnect();
                }
            }
        }
    }

    public Session getConnection() {
        return IESWebSocketClnt.this.session;
    }

    public WebSocketSender getSender() {
        return IESWebSocketClnt.this.wsSender;
    }

    public String getUrl() {
        return this.wsUrl;

    }

    private void open() {
        try {
            URI echoUri = new URI(wsUrl);

            webSocketClient.connect(handler, echoUri, request);
            webSocketClient.setMaxTextMessageBufferSize(Integer.MAX_VALUE);
            handler.awaitClose(WEBSOCKET_TIMEOUT, TimeUnit.SECONDS);
        } catch (IOException e) {
            openWebsocketFlag = false;
            LOGGER.error("Other Exception");
        } catch (InterruptedException e) {
            openWebsocketFlag = false;
            LOGGER.error("InterruptedException=", e);
        } catch (URISyntaxException e) {
            openWebsocketFlag = false;
            LOGGER.error("URISyntaxException=", e);
        } catch (Exception e) {
            openWebsocketFlag = false;
            LOGGER.error("client open exception : {},", e.getMessage());
        }
    }

    public void clientStop(WebSocketClient client) {
        try {
            if (client != null) {
                client.stop();
            }
        } catch (Exception e1) {
            LOGGER.error("client.stop() Exception");
        }
    }

    @WebSocket
    public class WebSocketEventHandler {
        private final CountDownLatch closeLatch;

        public WebSocketEventHandler() {
            this.closeLatch = new CountDownLatch(1);
        }

        public boolean awaitClose(int duration, TimeUnit unit) throws InterruptedException {
            return this.closeLatch.await(duration, unit);
        }

        @OnWebSocketClose
        public void onClose(int statusCode, String reason) {
            if (connection != null) {
                if (connection.isOpen()) {
                    connection.disconnect();
                }
            }

            LOGGER.warn("websocket closed!!!SsId={},url: {},type:{},infomation:{}", sessionId, wsUrl,
                String.valueOf(statusCode), reason);

            this.closeLatch.countDown();
        }

        @OnWebSocketConnect
        public void onConnect(Session session1) {
            LOGGER.warn("websocket is opened!!!,ssId={}, url: {}", sessionId, wsUrl);

            IESWebSocketClnt.this.session = session1;
            connection = ((WebSocketSession) session1).getConnection();

            openWebsocketFlag = true;

            WebSocketSender websocketSender = new WebSocketSender(session1);
            IESWebSocketClnt.this.wsSender = websocketSender;

            this.closeLatch.countDown();
        }

        @OnWebSocketError
        public void onError(Throwable thr) {
            if (thr instanceof UpgradeException) {
                statusCode = ((UpgradeException) thr).getResponseStatusCode();
                LOGGER.error("websocket is onError!!!,ssId={}, url:{}, httpcode : {}. ", sessionId, wsUrl, statusCode);
                LOGGER.error("websocket is onError!!!UpgradeException: ", thr);
            } else {
                LOGGER.error("websocket is onError!!!,ssId={}, url:{}.", sessionId, wsUrl);
                LOGGER.error("websocket is onError!!!error: ", thr);
            }

            openWebsocketFlag = false;
            this.closeLatch.countDown();
        }

        @OnWebSocketMessage
        public void onMessage(String message) {
            LOGGER.warn(basicLogInfo + ". " + message);
            updateWSStatus();

            MsgQueue.addtoMsgQueue(sessionId, message);

            LOGGER.info("end onMessage()");
        }

        @OnWebSocketFrame
        public void onFrame(Frame frame) {
            if ("PONG".equals(frame.getType().toString())) {
                LOGGER.warn("onFrame()!!!, PONG url = {}", wsUrl);
                updateWSStatus();
            }
            if ("PING".equals(frame.getType().toString())) {
                updateWSStatus();
            }
        }

        private void updateWSStatus() {
            WebsocketTunnelStatus websocketTunnelStatus = IESWebSocketClntManager.getSessionIdAndStatus()
                .get(sessionId);
            if (websocketTunnelStatus == null) {
                websocketTunnelStatus = new WebsocketTunnelStatus();
            } else {
                websocketTunnelStatus.updateLstRcvTime();
            }
            IESWebSocketClntManager.getSessionIdAndStatus().put(sessionId, websocketTunnelStatus);
        }

    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public boolean getOpenWebsocketFlag() {
        return openWebsocketFlag;
    }

    public void setOpenWebsocketFlag(boolean openWebsocketFlag) {
        this.openWebsocketFlag = openWebsocketFlag;
    }

    public WebSocketClient getWebSocketClient() {
        return webSocketClient;
    }

    public void setWebSocketClient(WebSocketClient webSocketClient) {
        this.webSocketClient = webSocketClient;
    }

    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }

    public WebSocketSender getWsSender() {
        return wsSender;
    }

    public void setWsSender(WebSocketSender wsSender) {
        this.wsSender = wsSender;
    }

    public String getWsUrl() {
        return wsUrl;
    }

    public void setWsUrl(String wsUrl) {
        this.wsUrl = wsUrl;
    }

    public WebSocketEventHandler getHandler() {
        return handler;
    }

    public void setHandler(WebSocketEventHandler handler) {
        this.handler = handler;
    }

    public IESWebSocketClnt() {

    }

    public RedisData getRedisData() {
        return redisData;
    }

    public void setRedisData(RedisData redisData) {
        this.redisData = redisData;
    }

    public int getStatusCode() {
        return statusCode;
    }

}

@flymoondust
Copy link
Author

The only strange going on is that the AbstractEventDriver seem not callback the onMessage func in the fisrt message,but then callback fine.

@lachlan-roberts
Copy link
Contributor

@flymoondust can you create a minimal reproduction test case? I cant seem to reproduce this same issue. I can reproduce all those same jetty debug logs to happen, but the onMessage still always receives the first text message.

@flymoondust
Copy link
Author

the server is a little complecated, it's implemented by netty, and nginx front of it.I can compare some different scene and get the debug log.wait for me to obtain the log.I'll look for the netty code of server,try to find how it response.

@lachlan-roberts
Copy link
Contributor

@flymoondust I don't think it would be a problem with the server if we have received and parsed the text frame.

We know the frame gets to AbstractEventDriver.incomingFrame() but does not make it to the endpoint onMessage, there is not much code between these two points, and very little of the code has been changed since 2013. So not sure how this would be possible.

@joakime any idea how to debug this?

@joakime
Copy link
Contributor

joakime commented Aug 26, 2020

Why do you have ...

        @OnWebSocketConnect
        public void onConnect(Session session1) {
            ...
            this.closeLatch.countDown(); // <-- this line in onConnect?
        }

You seem to be in a race to close the connection quickly after it's open?

@flymoondust
Copy link
Author

flymoondust commented Aug 26, 2020

i think this line would not cause the connection closed.I just use the closeLatch for timing.
In the function open(), I call awaitClose for waiting to be connected for 15 seconds, then connect,i call countDown() to stop timing,nothing more.

joakime added a commit that referenced this issue Aug 26, 2020
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
@joakime
Copy link
Contributor

joakime commented Aug 26, 2020

I created a PR #5202 that adds way more logging to the EventDriver layer.

@flymoondust can you build Jetty from branch jetty-9.4.x-5193-better-websocket-event-logging and see if this extra logging helps diagnose what's going on in that layer?

@flymoondust
Copy link
Author

flymoondust commented Aug 27, 2020

2020-08-27 20:00:13,088 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 487] Filled 38 bytes - DirectByteBuffer@503d98a2[p=0,l=38,c=18432,r=38]={<<<\x81\x11WebSocket_Data0_0\x81\x11WebSocket_Data1_0>>>er: produ...\x00\x00\x00\x00\x00\x00\x00}
2020-08-27 20:00:13,088 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@6eb0244[READING] getAction(DirectByteBuffer@503d98a2[p=0,l=38,c=18432,r=38]={<<<\x81\x11WebSocket_Data0_0\x81\x11WebSocket_Data1_0>>>er: produ...\x00\x00\x00\x00\x00\x00\x00})
2020-08-27 20:00:13,088 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 452] ReadState Action: PARSE
2020-08-27 20:00:13,088 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 302] CLIENT Parsing 38 bytes
2020-08-27 20:00:13,088 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 322] CLIENT OpCode TEXT, fin=true rsv=...
2020-08-27 20:00:13,089 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 104] CLIENT Payload Length: 17 - Parser@60bdba36[ExtensionStack,s=PAYLOAD_LEN,c=0,len=17,f=TEXT[len=0,fin=true,rsv=...,masked=false]]
2020-08-27 20:00:13,089 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 613] CLIENT Window: DirectByteBuffer@4b57590b[p=0,l=17,c=17,r=17]={<<<WebSocket_Data0_0>>>}
2020-08-27 20:00:13,089 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 256] CLIENT Parsed Frame: TEXT[len=17,fin=true,rsv=...,masked=false]
2020-08-27 20:00:13,089 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 189] CLIENT Notify ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]
2020-08-27 20:00:13,089 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 94] incomingFrame(TEXT[len=17,fin=true,rsv=...,masked=false])
2020-08-27 20:00:13,089 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 211] onFrame(TEXT[len=17,fin=true,rsv=...,masked=false]) - events.onFrame=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onFrame(org.eclipse.jetty.websocket.api.extensions.Frame),wantsSession=false,streaming=false]
2020-08-27 20:00:13,090 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 257] onTextFrame(DirectByteBuffer@4b57590b[p=0,l=17,c=17,r=17]={<<<WebSocket_Data0_0>>>}, true) - events.onText=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onMessage(java.lang.String),wantsSession=false,streaming=false]
2020-08-27 20:00:13,090 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@6eb0244[READING] getAction(DirectByteBuffer@503d98a2[p=19,l=38,c=18432,r=19]={\x81\x11WebSock...Data0_0<<<\x81\x11WebSocket_Data1_0>>>er: produ...\x00\x00\x00\x00\x00\x00\x00})
2020-08-27 20:00:13,090 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 452] ReadState Action: PARSE
2020-08-27 20:00:13,090 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 302] CLIENT Parsing 19 bytes
2020-08-27 20:00:13,090 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 322] CLIENT OpCode TEXT, fin=true rsv=...
2020-08-27 20:00:13,090 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 104] CLIENT Payload Length: 17 - Parser@60bdba36[ExtensionStack,s=PAYLOAD_LEN,c=0,len=17,f=TEXT[len=0,fin=true,rsv=...,masked=false]]
2020-08-27 20:00:13,090 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 613] CLIENT Window: DirectByteBuffer@52f98c19[p=0,l=17,c=17,r=17]={<<<WebSocket_Data1_0>>>}
2020-08-27 20:00:13,090 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 256] CLIENT Parsed Frame: TEXT[len=17,fin=true,rsv=...,masked=false]
2020-08-27 20:00:13,090 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.Parser 189] CLIENT Notify ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]
2020-08-27 20:00:13,091 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 94] incomingFrame(TEXT[len=17,fin=true,rsv=...,masked=false])
2020-08-27 20:00:13,091 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 211] onFrame(TEXT[len=17,fin=true,rsv=...,masked=false]) - events.onFrame=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onFrame(org.eclipse.jetty.websocket.api.extensions.Frame),wantsSession=false,streaming=false]
2020-08-27 20:00:13,091 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 257] onTextFrame(DirectByteBuffer@52f98c19[p=0,l=17,c=17,r=17]={<<<WebSocket_Data1_0>>>}, true) - events.onText=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onMessage(java.lang.String),wantsSession=false,streaming=false]
2020-08-27 20:00:13,092 DEBUG [HttpClient@370bed29-69][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 309] onTextMessage([17] "WebSocket_Data1_0") - events.onText=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onMessage(java.lang.String),wantsSession=false,streaming=false]
2020-08-27 20:00:13,092 WARN  [HttpClient@370bed29-69][ROOT][com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler 332] start onMessage()!!!,sessionId=9f97d6de-bb38-4ff3-a1d2-210cbc2b00b6,Get message from wss://10.185.156.20:26335/wss/sbirestgwtestservice/v1/websocket,message: ******. WebSocket_Data1_0
2020-08-27 20:00:13,092 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.HttpConversation 142] Exchanges in conversation 1, override=null, listeners=[org.eclipse.jetty.client.HttpRequest$15@214d65f5, org.eclipse.jetty.client.util.FutureResponseListener@32638755]

@flymoondust
Copy link
Author

the different is the first message don't call func onTextFram(),but i dont know why

@flymoondust
Copy link
Author

flymoondust commented Aug 27, 2020

`2020-08-27 20:18:52,200 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 452] ReadState Action: PARSE
2020-08-27 20:18:52,200 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 302] CLIENT Parsing 38 bytes
2020-08-27 20:18:52,201 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 322] CLIENT OpCode TEXT, fin=true rsv=...
2020-08-27 20:18:52,201 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 104] CLIENT Payload Length: 17 - Parser@3d16ef3e[ExtensionStack,s=PAYLOAD_LEN,c=0,len=17,f=TEXT[len=0,fin=true,rsv=...,masked=false]]
2020-08-27 20:18:52,201 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 613] CLIENT Window: DirectByteBuffer@6aeae829[p=0,l=17,c=17,r=17]={<<<WebSocket_Data0_0>>>}
2020-08-27 20:18:52,201 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 256] CLIENT Parsed Frame: TEXT[len=17,fin=true,rsv=...,masked=false]
2020-08-27 20:18:52,201 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 189] CLIENT Notify ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]
2020-08-27 20:18:52,201 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 94] incomingFrame(TEXT[len=17,fin=true,rsv=...,masked=false])
2020-08-27 20:18:52,201 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 211] onFrame(TEXT[len=17,fin=true,rsv=...,masked=false]) - events.onFrame=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onFrame(org.eclipse.jetty.websocket.api.extensions.Frame),wantsSession=false,streaming=false]
2020-08-27 20:18:52,202 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 257] onTextFrame(DirectByteBuffer@6aeae829[p=0,l=17,c=17,r=17]={<<<WebSocket_Data0_0>>>}, true) - events.onText=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onMessage(java.lang.String),wantsSession=false,streaming=false]
2020-08-27 20:18:52,202 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 272] activeMessage=org.eclipse.jetty.websocket.common.message.NullMessage@3939a75
2020-08-27 20:18:52,202 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@5278917[READING] getAction(DirectByteBuffer@4563b6a4[p=19,l=38,c=18432,r=19]={\x81\x11WebSock...Data0_0<<<\x81\x11WebSocket_Data1_0>>>er: produ...\x00\x00\x00\x00\x00\x00\x00})
2020-08-27 20:18:52,202 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 452] ReadState Action: PARSE
2020-08-27 20:18:52,202 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 302] CLIENT Parsing 19 bytes
2020-08-27 20:18:52,202 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 322] CLIENT OpCode TEXT, fin=true rsv=...
2020-08-27 20:18:52,202 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 104] CLIENT Payload Length: 17 - Parser@3d16ef3e[ExtensionStack,s=PAYLOAD_LEN,c=0,len=17,f=TEXT[len=0,fin=true,rsv=...,masked=false]]
2020-08-27 20:18:52,202 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 613] CLIENT Window: DirectByteBuffer@1e493b12[p=0,l=17,c=17,r=17]={<<<WebSocket_Data1_0>>>}
2020-08-27 20:18:52,202 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 256] CLIENT Parsed Frame: TEXT[len=17,fin=true,rsv=...,masked=false]
2020-08-27 20:18:52,203 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.Parser 189] CLIENT Notify ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]
2020-08-27 20:18:52,203 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 94] incomingFrame(TEXT[len=17,fin=true,rsv=...,masked=false])
2020-08-27 20:18:52,203 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 211] onFrame(TEXT[len=17,fin=true,rsv=...,masked=false]) - events.onFrame=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onFrame(org.eclipse.jetty.websocket.api.extensions.Frame),wantsSession=false,streaming=false]
2020-08-27 20:18:52,203 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 257] onTextFrame(DirectByteBuffer@1e493b12[p=0,l=17,c=17,r=17]={<<<WebSocket_Data1_0>>>}, true) - events.onText=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onMessage(java.lang.String),wantsSession=false,streaming=false]
2020-08-27 20:18:52,203 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 272] activeMessage=null
2020-08-27 20:18:52,204 DEBUG [HttpClient@1912b7f2-72][ROOT][org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver 314] onTextMessage([17] "WebSocket_Data1_0") - events.onText=OptionalSessionCallableMethod[pojo=com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler,method=public void com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler.onMessage(java.lang.String),wantsSession=false,streaming=false]
2020-08-27 20:18:52,205 WARN  [HttpClient@1912b7f2-72][ROOT][com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler 332] start onMessage()!!!,sessionId=0465ba8d-6ae4-4014-89a7-2da0fcd143c6,Get message from wss://10.185.156.20:26335/wss/sbirestgwtestservice/v1/websocket,message: ******. WebSocket_Data1_0
2020-08-27 20:18:52,209 WARN  [HttpClient@1912b7f2-72][ROOT][com.huawei.ies.restconnectorservice.connection.notify.service.MsgQueue 64] successful add message to sessionId 0465ba8d-6ae4-4014-89a7-2da0fcd143c6. WebSocket_Data1_0
`

@flymoondust
Copy link
Author

i add a additional log and found that when the first message come, the activeMessage=org.eclipse.jetty.websocket.common.message.NullMessage@3939a75,then the activeMessage=null

@lachlan-roberts
Copy link
Contributor

Ok that is strange... activeMessage should not be already set unless we are on a continuation frame.

Ahhh ok I think I see the issue now, there is a bug when we assign the NullMessage. After assigning this we return immediately, but we really need to still call appendMessage(buffer, fin) which will reset the activeMessage to null if fin is set. So you will have received a binary frame directly before this text frame that is silently discarded as you have not registered a binary onMessage method, and the NullMessage sticks around as the activeMessage as we skip the appendMessage call.

I will put up a PR with some new tests and a fix for this.
@flymoondust thanks for providing the additional logs for this.

@lachlan-roberts lachlan-roberts added this to To do in Jetty 9.4.32 via automation Aug 27, 2020
@flymoondust
Copy link
Author

So the scene is that when a binary message comes before the first text message, then the bug will happen?
But i don't find a binary annotation to register

@flymoondust
Copy link
Author

And i'm confused why jetty 9.4.19.v20190610 not has the bug?

@lachlan-roberts
Copy link
Contributor

So the scene is that when a binary message comes before the first text message, then the bug will happen?
But i don't find a binary annotation to register

@flymoondust Yes, you must have received a binary fin frame just before the text frame. The bug is triggered because you do not have the binary annotation registered, that is when NullMessage is used.

And i'm confused why jetty 9.4.19.v20190610 not has the bug?

The bug was introduced in PR #3885 which was released with jetty 9.4.20. So that explains why you do not have the bug in 9.4.19.

@lachlan-roberts
Copy link
Contributor

@flymoondust as a work around you could just register a dummy binary onMessage method. Something like this:

@OnWebSocketMessage
public void onMessage(byte[] array, int offset, int length)
{
}

lachlan-roberts added a commit that referenced this issue Aug 27, 2020
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Aug 27, 2020
…tion

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@flymoondust
Copy link
Author

flymoondust commented Aug 27, 2020

thanks, i'll try the binary method to try to fix this.

@flymoondust
Copy link
Author

yeah, this method work fine, the bug is fix by adding the following code

@OnWebSocketMessage
        public void onMessage(byte[] array, int offset, int length) {
            // just now don't care this message, just to fix the bug
            // see to https://github.com/eclipse/jetty.project/issues/5193
        }

@joakime
Copy link
Contributor

joakime commented Aug 27, 2020

So the scene is that when a binary message comes before the first text message, then the bug will happen?
But i don't find a binary annotation to register

@flymoondust Yes, you must have received a binary fin frame just before the text frame. The bug is triggered because you do not have the binary annotation registered, that is when NullMessage is used.

Good analysis!

But wouldn't his new debug logging output show this errant onBinaryFrame or onBinaryMessage (from the logging branch I created)?
It would probably show up before the section that the OP has copy/pasted a few times.

@lachlan-roberts
Copy link
Contributor

@flymoondust can you check the full logs you had to confirm whether you received a binary frame right before your problem occurred?

@flymoondust
Copy link
Author

flymoondust commented Aug 28, 2020

`WebSocketClientConnection@576c5be2::DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=19/300000}  
2020-08-25 04:52:13,127 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.websocket.common.WebSocketSession 457] [CLIENT] WebSocketSession.onSessionOpened()  
2020-08-25 04:52:13,127 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.websocket.common.WebSocketSession 473] [CLIENT] WebSocketSession.open()  
2020-08-25 04:52:13,127 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.websocket.common.WebSocketSession 489] [CLIENT] WebSocketSession.open() remote=WebSocketRemoteEndpoint@691925c8[batching=true]  
2020-08-25 04:52:13,127 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 207] openSession(WebSocketSession[websocket=JettyAnnotatedEventDriver[com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler@252df1fc],behavior=CLIENT,connection=WebSocketClientConnection@576c5be2::DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=19/300000},remote=WebSocketRemoteEndpoint@691925c8[batching=true],incoming=JettyAnnotatedEventDriver[com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler@252df1fc],outgoing=ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]])  
2020-08-25 04:52:13,127 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 208] objectFactory=org.eclipse.jetty.util.DecoratedObjectFactory[decorators=0]  
2020-08-25 04:52:13,128 WARN  [HttpClient@1015180b-72][ROOT][com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler 281] websocket is opened!!!,ssId=898f11f2-99b9-4b93-ac7b-4d66702ce307, url: wss://10.185.156.20:26335/wss/sbirestgwtestservice/v1/websocket  
2020-08-25 04:52:13,128 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.io.AbstractConnection 133] fillInterested WebSocketClientConnection@576c5be2::DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=20/300000}  
2020-08-25 04:52:13,128 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.io.FillInterest 79] interested FillInterest@5f5e9159{AC.ReadCB@576c5be2{WebSocketClientConnection@576c5be2::DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=FI,flush=-,to=0/300000}}}  
2020-08-25 04:52:13,128 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 837] >needFillInterest s=IDLE/IDLE uf=false ei=DirectByteBuffer@5ba5650c[p=217,l=351,c=18432,r=134]={\x17\x03\x03\x00\xD4\xDe\xB9\x9f\x03...54\xCfg\xCb5\xEf<<<\x17\x03\x03\x00!\xDe\xB9\x9f\x03\x01<wM#\xCb\t\xF93S\xF2\xCb\x80!\xCe/...\xA5\xB6u\xE3\xFa\xE8\xFa\xC7\x15\x18}7K\x0f\xB6\xEa;\xE8"\x91\xDc\xDf\x1e>>> & Servic...\x00\x00\x00\x00\x00\x00\x00} di=null SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=9/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=134/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=FI,flush=-,to=0/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=0,f=null]]  
2020-08-25 04:52:13,128 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 890] <needFillInterest s=IDLE/IDLE f=true i=false w=null  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.util.thread.QueuedThreadPool 543] queue SSL:SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=10/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=134/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=FI,flush=-,to=0/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=0,f=null]]:runFillable:BLOCKING startThread=0  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.util.thread.QueuedThreadPool$Runner 937] run SSL:SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=10/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=134/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=FI,flush=-,to=0/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=0,f=null]]:runFillable:BLOCKING in QueuedThreadPool[HttpClient@1015180b]@4ee8a11b{STARTED,8<=8<=200,i=1,r=8,q=0}[ReservedThreadExecutor@ebcbcb8{s=1/8,p=0}]  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.websocket.common.WebSocketSession 515] [CLIENT] open -> WebSocketSession@5452ad9d[behavior=CLIENT,batchMode=AUTO,idleTimeout=300000,requestURI=wss://10.185.156.20:26335/wss/sbirestgwtestservice/v1/websocket] - STARTED\n+- WebSocketClientConnection@576c5be2\n|  +> DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=FI,flush=-,to=0/300000}\n|  +> org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null]\n|  +> Generator[CLIENT,validating]\n|  +> Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=0,f=null]\n+= JettyAnnotatedEventDriver[com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler@252df1fc] - STARTED\n+= ExtensionStack@4efb2d6c[size=0,queueSize=0] - STARTED\nkey: +- bean, += managed, +~ unmanaged, +? auto, +: iterable, +] array, +@ map, +> undefined  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.FillInterest 99] fillable FillInterest@5f5e9159{AC.ReadCB@576c5be2{WebSocketClientConnection@576c5be2::DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=FI,flush=-,to=1/300000}}}  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 435] CLIENT onFillable()  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.client.HttpChannel 100] HttpExchange@58eb407a req=TERMINATED/null@null res=TERMINATED/null@null disassociated true from HttpChannelOverHTTP@8a459f4(exchange=null)[send=HttpSenderOverHTTP@5e89e2f4(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@6d3ecc48{s=START}],recv=HttpReceiverOverHTTP@759f0de7(rsp=IDLE,failure=null)[HttpParser{s=START,0 of -1}]]  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 447] CLIENT onFillable(ByteBuffer): java.nio.DirectByteBuffer[pos=0 lim=0 cap=18432]  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.client.AbstractConnectionPool 205] Connection removed HttpConnectionOverHTTP@556e2714::DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=1/300000} - pooled: 0  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@3731df77[READING] getAction(DirectByteBuffer@59bbbcd7[p=0,l=0,c=18432,r=0]={<<<>>>HTTP/1.1 ...\x00\x00\x00\x00\x00\x00\x00})  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 453] ReadState Action: FILL  
2020-08-25 04:52:13,129 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.client.HttpReceiver 540] Request/Response succeeded: Result[WebSocketUpgradeRequest[GET /wss/sbirestgwtestservice/v1/websocket HTTP/1.1]@30469602 > HttpResponse[HTTP/1.1 101 Switching Protocols]@585d5a3e] null  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest 495] onComplete() - Result[WebSocketUpgradeRequest[GET /wss/sbirestgwtestservice/v1/websocket HTTP/1.1]@30469602 > HttpResponse[HTTP/1.1 101 Switching Protocols]@585d5a3e] null  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 617] >fill SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=11/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=134/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=1/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=0,f=null]]  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.client.http.HttpReceiverOverHTTP 204] Parsed true, remaining 0 HttpParser{s=START,0 of -1}  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 634] fill NOT_HANDSHAKING  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.client.http.HttpReceiverOverHTTP 148] HttpConnectionOverHTTP@556e2714::DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=1/300000} upgraded  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ChannelEndPoint 250] filled 0 DirectByteBuffer@5ba5650c[p=217,l=351,c=18432,r=134]={\x17\x03\x03\x00\xD4\xDe\xB9\x9f\x03...54\xCfg\xCb5\xEf<<<\x17\x03\x03\x00!\xDe\xB9\x9f\x03\x01<wM#\xCb\t\xF93S\xF2\xCb\x80!\xCe/...\xA5\xB6u\xE3\xFa\xE8\xFa\xC7\x15\x18}7K\x0f\xB6\xEa;\xE8"\x91\xDc\xDf\x1e>>> & Servic...\x00\x00\x00\x00\x00\x00\x00}  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.client.http.HttpReceiverOverHTTP 115] Released RetainableByteBuffer@18005fd6{DirectByteBuffer@465595cf[p=0,l=0,c=16384,r=0]={<<<>>>HTTP/1.1 ...\x00\x00\x00\x00\x00\x00\x00},r=0}  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 683] net filled=0  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 712] unwrap net_filled=0 Status = OK HandshakeStatus = NOT_HANDSHAKING bytesConsumed = 38 bytesProduced = 9 encryptedBuffer=[p=255,l=351,c=18432,r=96] unwrapBuffer=DirectByteBuffer@59bbbcd7[p=0,l=9,c=18432,r=9]={<<<\x82\x07success>>>101 Switc...\x00\x00\x00\x00\x00\x00\x00} appBuffer=DirectByteBuffer@59bbbcd7[p=0,l=9,c=18432,r=9]={<<<\x82\x07success>>>101 Switc...\x00\x00\x00\x00\x00\x00\x00}  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.io.ssl.SslConnection 401] <c.onFillable SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=11/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=134/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=2/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=0,f=null]]  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 813] <fill f=9 uf=false SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=11/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=96/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=2/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=0,f=null]]  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-72][ROOT][org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread 298] ReservedThreadExecutor@ebcbcb8{s=2/8,p=0}@44fec821 waiting  
2020-08-25 04:52:13,130 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 488] Filled 9 bytes - DirectByteBuffer@59bbbcd7[p=0,l=9,c=18432,r=9]={<<<\x82\x07success>>>101 Switc...\x00\x00\x00\x00\x00\x00\x00}  
2020-08-25 04:52:13,131 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@3731df77[READING] getAction(DirectByteBuffer@59bbbcd7[p=0,l=9,c=18432,r=9]={<<<\x82\x07success>>>101 Switc...\x00\x00\x00\x00\x00\x00\x00})  
2020-08-25 04:52:13,131 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 453] ReadState Action: PARSE  
2020-08-25 04:52:13,131 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 302] CLIENT Parsing 9 bytes  
2020-08-25 04:52:13,131 WARN  [pool-9-thread-1][ROOT][com.huawei.ies.restconnectorservice.connection.retry.RetryJob 59] websocket retrying end,retrying success,sessionId=898f11f2-99b9-4b93-ac7b-4d66702ce307  
2020-08-25 04:52:13,131 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 322] CLIENT OpCode BINARY, fin=true rsv=...  
2020-08-25 04:52:13,131 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 104] CLIENT Payload Length: 7 - Parser@74c5f1a8[ExtensionStack,s=PAYLOAD_LEN,c=0,len=7,f=BINARY[len=0,fin=true,rsv=...,masked=false]]  
2020-08-25 04:52:13,131 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 613] CLIENT Window: DirectByteBuffer@563ef8c4[p=0,l=7,c=7,r=7]={<<<success>>>}  
2020-08-25 04:52:13,131 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 256] CLIENT Parsed Frame: BINARY[len=7,fin=true,rsv=...,masked=false]  
2020-08-25 04:52:13,131 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 189] CLIENT Notify ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]  
2020-08-25 04:52:13,132 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 92] incomingFrame(BINARY[len=7,fin=true,rsv=...,masked=false])  
2020-08-25 04:52:13,132 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@3731df77[READING] getAction(DirectByteBuffer@59bbbcd7[p=9,l=9,c=18432,r=0]={\x82\x07success<<<>>>101 Switc...\x00\x00\x00\x00\x00\x00\x00})  
2020-08-25 04:52:13,132 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 453] ReadState Action: FILL  
2020-08-25 04:52:13,132 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 617] >fill SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=13/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=96/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=4/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=7,f=null]]  
2020-08-25 04:52:13,132 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 634] fill NOT_HANDSHAKING  
2020-08-25 04:52:13,132 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ChannelEndPoint 250] filled 96 DirectByteBuffer@5ba5650c[p=255,l=447,c=18432,r=192]={\x17\x03\x03\x00\xD4\xDe\xB9\x9f\x03...\xA4[\xEc\xCe\xE5\x95\xE4<<<\x17\x03\x03\x00+\xDe\xB9\x9f\x03\x01<wN[\x8e\xCc!]\xAb\xA7C\xCe)\x9c\xB9...\x9d\x19\xB0\x1e6\xAc\xD2\xD4\xBf>\x1a>\x86\x9c\xDf~\xE9\xEe\\\xAc)C\xF3>>>\x82\x01\x01\x00\xEc\xE7\xD6:\xC9...\x00\x00\x00\x00\x00\x00\x00}  
2020-08-25 04:52:13,133 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 683] net filled=96  
2020-08-25 04:52:13,133 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 712] unwrap net_filled=96 Status = OK HandshakeStatus = NOT_HANDSHAKING bytesConsumed = 48 bytesProduced = 19 encryptedBuffer=[p=303,l=447,c=18432,r=144] unwrapBuffer=DirectByteBuffer@59bbbcd7[p=0,l=19,c=18432,r=19]={<<<\x81\x11WebSocket_Data0_0>>>ing Proto...\x00\x00\x00\x00\x00\x00\x00} appBuffer=DirectByteBuffer@59bbbcd7[p=0,l=19,c=18432,r=19]={<<<\x81\x11WebSocket_Data0_0>>>ing Proto...\x00\x00\x00\x00\x00\x00\x00}  
2020-08-25 04:52:13,133 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 813] <fill f=19 uf=false SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=0/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=144/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=4/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=7,f=null]]  
2020-08-25 04:52:13,133 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 488] Filled 19 bytes - DirectByteBuffer@59bbbcd7[p=0,l=19,c=18432,r=19]={<<<\x81\x11WebSocket_Data0_0>>>ing Proto...\x00\x00\x00\x00\x00\x00\x00}  
2020-08-25 04:52:13,133 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@3731df77[READING] getAction(DirectByteBuffer@59bbbcd7[p=0,l=19,c=18432,r=19]={<<<\x81\x11WebSocket_Data0_0>>>ing Proto...\x00\x00\x00\x00\x00\x00\x00})  
2020-08-25 04:52:13,133 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 453] ReadState Action: PARSE  
2020-08-25 04:52:13,133 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 302] CLIENT Parsing 19 bytes  
2020-08-25 04:52:13,133 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 322] CLIENT OpCode TEXT, fin=true rsv=...  
2020-08-25 04:52:13,133 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 104] CLIENT Payload Length: 17 - Parser@74c5f1a8[ExtensionStack,s=PAYLOAD_LEN,c=0,len=17,f=TEXT[len=0,fin=true,rsv=...,masked=false]]  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 613] CLIENT Window: DirectByteBuffer@54d48ae9[p=0,l=17,c=17,r=17]={<<<WebSocket_Data0_0>>>}  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 256] CLIENT Parsed Frame: TEXT[len=17,fin=true,rsv=...,masked=false]  
2020-08-25 04:52:13,134 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.HttpConversation 142] Exchanges in conversation 1, override=null, listeners=[org.eclipse.jetty.client.HttpRequest$15@6960a834, org.eclipse.jetty.client.util.FutureResponseListener@368420b4]  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 189] CLIENT Notify ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]  
2020-08-25 04:52:13,134 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.HttpDestination 286] Queued HttpRequest[GET /rest/ies/driverrouter/v1/driver/url HTTP/1.1]@7c6c8589 for HttpDestination[https://10.185.156.20:32018]@b7cfdd7,queue=1,pool=DuplexConnectionPool@7df86f23[c=0/1/100,a=0,i=1]  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 92] incomingFrame(TEXT[len=17,fin=true,rsv=...,masked=false])  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@3731df77[READING] getAction(DirectByteBuffer@59bbbcd7[p=19,l=19,c=18432,r=0]={\x81\x11WebSock...Data0_0<<<>>>ing Proto...\x00\x00\x00\x00\x00\x00\x00})  
2020-08-25 04:52:13,134 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.AbstractConnectionPool 172] Connection active HttpConnectionOverHTTP@1adb3b51::DecryptedEndPoint@726cd4b0{/10.185.156.20:32018<->/10.185.156.20:38316,OPEN,fill=FI,flush=-,to=75/30000}  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 453] ReadState Action: FILL  
2020-08-25 04:52:13,134 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.HttpDestination 334] Processing exchange HttpExchange@789eea80 req=PENDING/null@null res=PENDING/null@null on HttpConnectionOverHTTP@1adb3b51::DecryptedEndPoint@726cd4b0{/10.185.156.20:32018<->/10.185.156.20:38316,OPEN,fill=FI,flush=-,to=75/30000} of HttpDestination[https://10.185.156.20:32018]@b7cfdd7,queue=0,pool=DuplexConnectionPool@7df86f23[c=0/1/100,a=1,i=0]  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 617] >fill SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=1/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=144/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=6/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=17,f=null]]  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 634] fill NOT_HANDSHAKING  
2020-08-25 04:52:13,134 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.HttpConnection 89] Normalizing true HttpRequest[GET /rest/ies/driverrouter/v1/driver/url HTTP/1.1]@7c6c8589  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ChannelEndPoint 250] filled 0 DirectByteBuffer@5ba5650c[p=303,l=447,c=18432,r=144]={\x17\x03\x03\x00\xD4\xDe\xB9\x9f\x03...G\xDb\xA7\xA4\xE4l\x90<<<\x17\x03\x03\x00+\xDe\xB9\x9f\x03\x01<wOVLf\x9c\x14\x97L\xAaB\x89R\xDe...\x9d\x19\xB0\x1e6\xAc\xD2\xD4\xBf>\x1a>\x86\x9c\xDf~\xE9\xEe\\\xAc)C\xF3>>>\x82\x01\x01\x00\xEc\xE7\xD6:\xC9...\x00\x00\x00\x00\x00\x00\x00}  
2020-08-25 04:52:13,134 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 683] net filled=0  
2020-08-25 04:52:13,135 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.HttpChannel 79] HttpExchange@789eea80 req=PENDING/null@null res=PENDING/null@null associated true to HttpChannelOverHTTP@515cd923(exchange=HttpExchange@789eea80 req=PENDING/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@129e61ea(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@6c3ee5d{s=START}],recv=HttpReceiverOverHTTP@4e0c83fb(rsp=IDLE,failure=null)[HttpParser{s=START,0 of -1}]]  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 712] unwrap net_filled=0 Status = OK HandshakeStatus = NOT_HANDSHAKING bytesConsumed = 48 bytesProduced = 19 encryptedBuffer=[p=351,l=447,c=18432,r=96] unwrapBuffer=DirectByteBuffer@59bbbcd7[p=0,l=19,c=18432,r=19]={<<<\x81\x11WebSocket_Data1_0>>>ing Proto...\x00\x00\x00\x00\x00\x00\x00} appBuffer=DirectByteBuffer@59bbbcd7[p=0,l=19,c=18432,r=19]={<<<\x81\x11WebSocket_Data1_0>>>ing Proto...\x00\x00\x00\x00\x00\x00\x00}  
2020-08-25 04:52:13,135 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.HttpSender 227] Request begin HttpRequest[GET /rest/ies/driverrouter/v1/driver/url HTTP/1.1]@7c6c8589  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint 813] <fill f=19 uf=false SslConnection@2c568ded::SocketChannelEndPoint@410e414c{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=2/300000}{io=0/0,kio=0,kro=1}->SslConnection@2c568ded{NOT_HANDSHAKING,eio=96/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@5d317945{/10.185.156.20:26335<->/10.185.156.20:40482,OPEN,fill=-,flush=-,to=6/300000}=>WebSocketClientConnection@576c5be2[s=ConnectionState@73fd39d2[OPENED],f=org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection$Flusher@41c31139[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@74c5f1a8[ExtensionStack,s=START,c=0,len=17,f=null]]  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 488] Filled 19 bytes - DirectByteBuffer@59bbbcd7[p=0,l=19,c=18432,r=19]={<<<\x81\x11WebSocket_Data1_0>>>ing Proto...\x00\x00\x00\x00\x00\x00\x00}  
2020-08-25 04:52:13,135 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.HttpSender 245] Request headers HttpRequest[GET /rest/ies/driverrouter/v1/driver/url HTTP/1.1]@7c6c8589\nAccept-Encoding: gzip\r\nUser-Agent: Jetty/9.4.28.v20200408\r\nx-request-id: RouteID-driverframeworkservice-1-0-200825045213-240\r\nx-org-id: default-organization-id\r\nContent-Type: application/json;charset=UTF-8\r\nx-trace-id: 8661138481779948697\r\nx-parent-id: 0\r\nx-span-id: 8661138481779948697\r\nx-sampling: true\r\nx-solution-version: \r\nx-solution-org: \r\nx-trace-bizid: \r\nHost: 10.185.156.20:32018  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.ReadState 63] ReadState@3731df77[READING] getAction(DirectByteBuffer@59bbbcd7[p=0,l=19,c=18432,r=19]={<<<\x81\x11WebSocket_Data1_0>>>ing Proto...\x00\x00\x00\x00\x00\x00\x00})  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection 453] ReadState Action: PARSE  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 302] CLIENT Parsing 19 bytes  
2020-08-25 04:52:13,135 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.HttpContent 182] Advanced content to last chunk  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 322] CLIENT OpCode TEXT, fin=true rsv=...  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 104] CLIENT Payload Length: 17 - Parser@74c5f1a8[ExtensionStack,s=PAYLOAD_LEN,c=0,len=17,f=TEXT[len=0,fin=true,rsv=...,masked=false]]  
2020-08-25 04:52:13,135 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.http.HttpSenderOverHTTP$HeadersCallback 219] Generated headers (-1 bytes), chunk (-1 bytes), content (0 bytes) - NEED_HEADER/HttpGenerator@6c3ee5d{s=START}  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 613] CLIENT Window: DirectByteBuffer@12659ea[p=0,l=17,c=17,r=17]={<<<WebSocket_Data1_0>>>}  
2020-08-25 04:52:13,135 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.http.HttpGenerator 601] generateHeaders GET{u=/rest/ies/driverrouter/v1/driver/url?resourceInnerId=370a0f41-fcf3-4481-aa37-35b94bd6f6c10&serviceUrl=/v1/recover/time,HTTP/1.1,h=13,cl=-1} last=true content=HeapByteBuffer@1ced4e6a[p=0,l=0,c=0,r=0]={<<<>>>}  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 256] CLIENT Parsed Frame: TEXT[len=17,fin=true,rsv=...,masked=false]  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.Parser 189] CLIENT Notify ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]  
2020-08-25 04:52:13,135 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.http.HttpGenerator 602] Accept-Encoding: gzip\r\nUser-Agent: Jetty/9.4.28.v20200408\r\nx-request-id: RouteID-driverframeworkservice-1-0-200825045213-240\r\nx-org-id: default-organization-id\r\nContent-Type: application/json;charset=UTF-8\r\nx-trace-id: 8661138481779948697\r\nx-parent-id: 0\r\nx-span-id: 8661138481779948697\r\nx-sampling: true\r\nx-solution-version: \r\nx-solution-org: \r\nx-trace-bizid: \r\nHost: 10.185.156.20:32018\r\n\r\n  
2020-08-25 04:52:13,135 DEBUG [HttpClient@1015180b-84][ROOT][org.eclipse.jetty.websocket.common.events.AbstractEventDriver 92] incomingFrame(TEXT[len=17,fin=true,rsv=...,masked=false])  
2020-08-25 04:52:13,136 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.http.HttpGenerator 780] CONTENT_LENGTH  
2020-08-25 04:52:13,136 WARN  [HttpClient@1015180b-84][ROOT][com.huawei.ies.restconnectorservice.connection.IESWebSocketClnt$WebSocketEventHandler 332] start onMessage()!!!,sessionId=898f11f2-99b9-4b93-ac7b-4d66702ce307,Get message from wss://10.185.156.20:26335/wss/sbirestgwtestservice/v1/websocket,message: ******. WebSocket_Data1_0  
2020-08-25 04:52:13,136 DEBUG [pool-9-thread-1][ROOT][org.eclipse.jetty.client.http.HttpSenderOverHTTP$HeadersCallback 219] Generated headers (544 bytes), chunk (-1 bytes), content (0 bytes) - FLUSH/HttpGenerator@6c3ee5d{s=COMPLETING}  ```

@flymoondust
Copy link
Author

flymoondust commented Aug 28, 2020

yeah, binary message can be found in the old debug log,it's a message of 'success'.
So, in my opinion,the bug is triggered when the fisrt message come because when the connection is opened, the server will send a binary message before the text message.
And if the server send binary message before every text message,then i'll never recieve any message at all.

@joakime joakime changed the title websocketclient the OnWebSocketMessage is not callback on the first message WebSocket unimplemented BINARY message handling can result in TEXT message delivery to fail Aug 28, 2020
@joakime joakime moved this from To do to In progress in Jetty 9.4.32 Aug 28, 2020
joakime added a commit that referenced this issue Aug 28, 2020
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
lachlan-roberts added a commit that referenced this issue Sep 2, 2020
Issue #5193 - fix lost websocket messages when only one OnWebSocketMessage annotation used
@lachlan-roberts
Copy link
Contributor

Fixed with PR #5208.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Jetty 9.4.32
  
Done
3 participants