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

Reconnect logic spamming logs and creating threads until resource exhaustion occurs #97

Open
dcmeglio opened this issue Dec 25, 2022 · 0 comments · May be fixed by #98
Open

Reconnect logic spamming logs and creating threads until resource exhaustion occurs #97

dcmeglio opened this issue Dec 25, 2022 · 0 comments · May be fixed by #98

Comments

@dcmeglio
Copy link

dcmeglio commented Dec 25, 2022

Describe the bug
It seems to be if a disconnect happens, my logs flood with:
Connection closed Connection is already closed

It happens dozens of times a second until it seems my app just crashes and restarts. Note that each log entry has a different thread id. It seems you're spawning threads until things run out.

To Reproduce
Steps to reproduce the behavior:

  1. Let a disconnect error occur.

Expected behavior
The reconnect logic shouldn't be cause the process to die. Also my reconnect interval is set to 5s which doesn't seem to be respected

Screenshots
2022-12-24 13:52:43.497 WARNING (Thread-93786 (deferred_reconnect)) [SignalRCoreClient] Connection closed Connection is already closed.
2022-12-24 13:52:43.509 WARNING (Thread-93787 (deferred_reconnect)) [SignalRCoreClient] Connection closed Connection is already closed.
2022-12-24 13:52:43.523 ERROR (Thread-93530 (deferred_reconnect)) [SignalRCoreClient]
2022-12-24 13:52:43.533 ERROR (Thread-93534 (deferred_reconnect)) [SignalRCoreClient]
2022-12-24 13:52:43.540 ERROR (Thread-93535 (deferred_reconnect)) [SignalRCoreClient]
2022-12-24 13:52:43.550 WARNING (Thread-93788 (deferred_reconnect)) [SignalRCoreClient] Connection closed Connection is already closed.
2022-12-24 13:52:43.556 WARNING (Thread-93789 (deferred_reconnect)) [SignalRCoreClient] Connection closed Connection is already closed.
2022-12-24 13:52:43.575 WARNING (Thread-93790 (deferred_reconnect)) [SignalRCoreClient] Connection closed Connection is already closed.
2022-12-24 13:52:43.590 ERROR (Thread-93536 (deferred_reconnect)) [SignalRCoreClient]
2022-12-24 13:52:43.598 ERROR (Thread-93538 (deferred_reconnect)) [SignalRCoreClient]
2022-12-24 13:52:43.604 ERROR (Thread-93533 (deferred_reconnect)) [SignalRCoreClient]
2022-12-24 13:52:43.653 ERROR (Thread-93537 (deferred_reconnect)) [SignalRCoreClient]
2022-12-24 13:52:43.671 ERROR (Thread-93540 (deferred_reconnect)) [SignalRCoreClient]
2022-12-24 13:52:43.676 WARNING (Thread-93791 (deferred_reconnect)) [SignalRCoreClient] Connection closed Connection is already closed.

Desktop (please complete the following information):

  • OS: rPI running HAOS

Additional context
Edit: I'm rather confused by how this library is supposed to work. You launch run_forever in a thread, but run_forever creates a thread already. The thread you create is never joined, yet on a reconnect, you create a new thread. So the old thread, I think, lives forever? So during a reconnect loop I'd expect we'd just be creating thread after thread, right?

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 a pull request may close this issue.

1 participant