We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95d52a0 commit 4508575Copy full SHA for 4508575
server/aws-lsp-codewhisperer/src/language-server/workspaceContext/client.ts
@@ -82,7 +82,9 @@ export class WebSocketClient {
82
// Apply exponential backoff for both unclean closures and failed reconnection attempts
83
if (this.reconnectAttempts < this.maxReconnectAttempts) {
84
this.reconnectAttempts++
85
- const delay = Math.min(1000 * Math.pow(2, this.reconnectAttempts), 30000)
+ const baseDelay = Math.min(1000 * Math.pow(2, this.reconnectAttempts), 30000)
86
+ const jitter = Math.random() * 5000 // jitter of 0 ~ 5000 milliseconds
87
+ const delay = baseDelay + jitter
88
this.logging.log(
89
`WebSocket will attempt reconnection ${this.reconnectAttempts}/${this.maxReconnectAttempts} in ${delay}s`
90
)
0 commit comments