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: remove infinite loop in subscription causing high cpu #207

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

rolznz
Copy link
Contributor

@rolznz rolznz commented Jan 5, 2024

Fixes #205

service.go Outdated
svc.Logger.Errorf("Subscription error %v", ctx.Err())
return ctx.Err()
}
svc.Logger.Info("Exiting subscription.")
Copy link
Contributor

Choose a reason for hiding this comment

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

if the connection fails we have to wait and retry the connection. is this unaffected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bumi I tested it against a locally-running relay. There was an issue which I fixed in dd59887.

We currently do not wait but immediately retry - I added a temporary 10 second sleep to test it and it successfully reconnects after I shut down the relay (killing the connection) and restart it.

If the relay cannot be immediately re-connected to, NWC will close. So maybe we should wait (however we haven't been doing that and it seems to work)

@rolznz rolznz merged commit 3289026 into main Jan 9, 2024
2 checks passed
@bumi bumi deleted the fix/high-cpu branch February 17, 2024 14:07
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.

High CPU Utilization
2 participants