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 crash due to missing error listener on socket #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

twendt
Copy link

@twendt twendt commented May 8, 2019

I ran into an issue where the client crashes due to a missing error event listener on the socket. This happens when the ccu is not reachable and I keep trying to connect. The client uses a timeout and deletes all event listeners if no response is received. This results in a short period where there is no error listener defined and that is not allowed. If now a response comes in during that period then the client crashed.

Here I am now defining an empty function error listener that will always stay configured. The actual error handling is then done with a second listener. During writeEnd I then delete every listener, but not the empty error listener.

@hobbyquaker
Copy link
Owner

Danke für den PR. Habs jetzt nur kurz überflogen, aber ehrlich gesagt noch nicht ganz kapiert. Komm voraussichtlich frühestens am Wochende dazu mir das genau anzuschauen. Hast Du schon eine Idee warum der Malformed-Response Test nun fehlschlägt?

@hobbyquaker
Copy link
Owner

Vorschlag: Könntest Du einen Test bauen der den Crash den Du mit diesem PR beheben willst (wegen fehlender Error Listener) reproduziert? Das würde mir helfen das ganze zu verstehen.

@coveralls
Copy link

coveralls commented May 9, 2019

Coverage Status

Coverage increased (+0.05%) to 91.515% when pulling 993c7d2 on twendt:master into 4206e2c on hobbyquaker:master.

@twendt
Copy link
Author

twendt commented May 9, 2019

Ich habe den Test gefixed. Da fehlte der function Parameter bei einem Aufruf von writeEnd, dadurch ist der removeListener fehlgeschlagen.

Einen Test für mein Problem zu bauen ist eine super Idee, ich bin mir nur noch nicht sicher, wie das funktionieren könnte.

@twendt
Copy link
Author

twendt commented May 26, 2019

Was machen wir mit dem PR?

@hobbyquaker
Copy link
Owner

@twendt sorry, voll verpennt. Gib mir Zeit bis zum nächsten Wochenende.

@twendt
Copy link
Author

twendt commented May 26, 2019

Kein Problem ich habe vorerst auf eine namespaced Version umgestellt.

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.

None yet

3 participants