eugenegujing commented on code in PR #8855:
URL: https://github.com/apache/texera/pull/8855#discussion_r4225780346


##########
frontend/src/app/workspace/service/workflow-websocket/workflow-websocket.service.ts:
##########
@@ -117,6 +117,9 @@ export class WorkflowWebsocketService {
     this.websocket = webSocket<TexeraWebsocketEvent | 
TexeraWebsocketRequest>(websocketUrl);
     // setup reconnection logic
     const wsWithReconnect = this.websocket.pipe(
+      // A server-side close with a close frame completes the socket instead 
of erroring;
+      // turn the completion into an error so the retry below reports the drop 
and redials.
+      concatWith(throwError(() => new Error("websocket closed by the 
server"))),

Review Comment:
   Good point, thanks! Instead of a retry limit, I went with an approach I 
think works better: a clean close now redials only if the server had sent 
something on that connection. The master refuses a session before sending 
anything, so the admin page now makes a single attempt. Compared with a limit, 
a refused session costs no extra attempts, there's no count to tune, and the 
retries of a session that was actually up stay uncapped, so a long restart 
isn't cut off.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to