bito-code-review[bot] commented on PR #43434:
URL: https://github.com/apache/superset/pull/43434#issuecomment-5387476636
<!-- Bito Reply -->
The flagged issue is correct. Starting an asynchronous subscription without
awaiting its initialization or handling potential connection failures can lead
to a silent failure where the WebSocket server remains active but unable to
deliver realtime messages. To resolve this, you should wrap the subscription
logic in an initialization function that is awaited before the server begins
accepting traffic, and implement a robust error handler that prevents startup
or triggers a retry mechanism if the Redis connection or subscription fails.
**superset-websocket/src/index.ts**
```
async function startServer() {
try {
await initializeRedisSubscription();
await startHttpServer();
} catch (error) {
console.error('Failed to start server:', error);
process.exit(1);
}
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]