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

Fix bug in chain event resubscribe #1819

Merged
merged 4 commits into from
Oct 10, 2023
Merged

Fix bug in chain event resubscribe #1819

merged 4 commits into from
Oct 10, 2023

Conversation

bitwiseguy
Copy link
Contributor

The bug fixed in this PR was causing the cloud nodes to crash repeatedly because even when resubscribing to chain events was successful, an error was being sent on the errorChan, which triggers a panic. The fix involves the use of a resubscribed boolean flag to indicate if an error should be sent on the errorChan or not

@netlify
Copy link

netlify bot commented Oct 9, 2023

👷 Deploy Preview for nitrodocs processing.

Name Link
🔨 Latest commit 9cbd41b
🔍 Latest deploy log https://app.netlify.com/sites/nitrodocs/deploys/6525814718c7330008a79379

@netlify
Copy link

netlify bot commented Oct 9, 2023

Deploy Preview for nitro-payment-demo canceled.

Name Link
🔨 Latest commit 9cbd41b
🔍 Latest deploy log https://app.netlify.com/sites/nitro-payment-demo/deploys/6525814793f2c90008889b38

errorChan <- fmt.Errorf("subscribeFilterLogs failed to resubscribe")
return
}
}()

case <-time.After(RESUB_INTERVAL):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably out of scope for this PR, but a thought that came to mind: we are intentionally closing the websocket connection every 15 seconds, then catching that error and resubscribing. It seems like polling the chain every 15 seconds instead of setting up a 15-second long subscription would be more efficient. Further details noted in this issue: #1798

@bitwiseguy bitwiseguy merged commit e7e508f into main Oct 10, 2023
6 of 7 checks passed
@geoknee geoknee deleted the fix-resubscribe branch October 10, 2023 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants