oceanbase / odc

OceanBase Developer Center(ODC), An open-source, enterprise-grade database tool for collaborative development
https://github.com/oceanbase/odc
Apache License 2.0
536 stars 55 forks source link

[Bug]: The connection is interrupted after pasting 3M sql in the command line window #2843

Closed PeachThinking closed 1 month ago

PeachThinking commented 4 months ago

ODC version

odc424-20240413

OB version

.

What happened?

After copying and pasting a 2.8MB SQL script, the command line window shows that the connection is disconnected:

[2024-06-24 13:19:56.301][http-nio-8989-exec-4][,,][INFO][com.oceanbase.odc.server.web.websocket.WebSocketServer][197]: obclient session initializing, resourceId=sid:eyJkYklkIjozNCwiZHNJZCI6MiwiZnJvbSI6IjEwLjE1Ni4xOTIuMTEiLCJyZWFsSWQiOiIzMWEyMDFkYmEwIn0=, sessionId=19
[2024-06-24 13:19:56.302][http-nio-8989-exec-4][,,][INFO][com.oceanbase.odc.server.web.websocket.WebSocketServer][303]: user odcuser_10001 already exists
[2024-06-24 13:19:56.303][http-nio-8989-exec-4][,,][INFO][com.oceanbase.odc.server.web.websocket.WebSocketServer][240]: command to be execute: su -c /opt/odc/obclient/bin/obclient -hXXXXXX -P2883 -uXXXXX -D"AFAER" --ob-disable_commands connect,conn,edit,nopager,notee,pager,print,prompt,rehash,system,tee,resetconnection -pXXXX -s /bin/sh
[2024-06-24 13:19:56.326][Obclient_Read_Thread_1505744591][,,][INFO][com.oceanbase.odc.service.websocket.OBClientReadThread][42]: Obclient threadid:215803 start to run
[2024-06-24 13:19:56.326][http-nio-8989-exec-4][,,][INFO][com.oceanbase.odc.server.web.websocket.WebSocketServer][242]: "SYS" has established connection with obclient, current connection number is 2, session id: 19
[2024-06-24 13:19:56.326][http-nio-8989-exec-4][,,][INFO][com.oceanbase.odc.server.web.websocket.WebSocketServer][200]: obclient session initialized, resourceId=sid:eyJkYklkIjozNCwiZHNJZCI6MiwiZnJvbSI6IjEwLjE1Ni4xOTIuMTEiLCJyZWFsSWQiOiIzMWEyMDFkYmEwIn0=, sessionId=19
[2024-06-24 13:20:02.028][http-nio-8989-exec-7][,,][INFO][com.oceanbase.odc.server.web.websocket.WebSocketServer][355]: Terminate connection. Current connnection number is 1
[2024-06-24 13:20:02.028][Obclient_Read_Thread_1505744591][,,][ERROR][com.oceanbase.odc.server.web.websocket.WebSocketServer][398]: Error occurs when send message back
java.lang.IllegalStateException: Message will not be sent because the WebSocket session has been closed
    at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:442) ~[tomcat-embed-websocket-9.0.62.jar!/:?]
    at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:314) ~[tomcat-embed-websocket-9.0.62.jar!/:?]
    at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:254) ~[tomcat-embed-websocket-9.0.62.jar!/:?]
    at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendString(WsRemoteEndpointImplBase.java:195) ~[tomcat-embed-websocket-9.0.62.jar!/:?]
    at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendObject(WsRemoteEndpointImplBase.java:618) ~[tomcat-embed-websocket-9.0.62.jar!/:?]
    at org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendObject(WsRemoteEndpointBasic.java:74) ~[tomcat-embed-websocket-9.0.62.jar!/:?]
    at com.oceanbase.odc.server.web.websocket.WebSocketServer.sendMessage(WebSocketServer.java:396) ~[classes!/:?]
    at com.oceanbase.odc.server.web.websocket.WebSocketServer.lambda$connectObClient$1(WebSocketServer.java:235) ~[classes!/:?]
    at com.oceanbase.odc.service.websocket.OBClientReadThread.run(OBClientReadThread.java:66) [odc-service-4.2.4-20240413.jar!/:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_392]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_392]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_392]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_392]
    at java.lang.Thread.run(Thread.java:750) [?:1.8.0_392]
[2024-06-24 13:20:02.028][Obclient_Read_Thread_1505744591][,,][INFO][com.oceanbase.odc.service.websocket.OBClientReadThread][79]: Obclient thread end, threadId=215803

What did you expect to happen?

Use the command line window normally

How can we reproduce it (as minimally and precisely as possible)?

After copying and pasting a 2.8MB SQL script, the command line window shows that the connection is disconnected

Anything else we need to know?

No response

LuckyPickleZZ commented 1 month ago

This is by design because ODC has already indicated the max message size is 512KB

Image