-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[yamahareceiver] connect timed out since 2.5M4 fix #6835
Conversation
Travis tests were successfulHey @zarusz, |
1 similar comment
Travis tests were successfulHey @zarusz, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tiny remarks, looks good. Thanks!
throw new IOException( | ||
"Menu still not ready after " + YamahaReceiverBindingConstants.MENU_MAX_WAITING_TIME + "ms"); | ||
logger.info("Menu still not ready after " + YamahaReceiverBindingConstants.MENU_MAX_WAITING_TIME + "ms. The menu state will be out of sync."); | ||
// ToDo: this needs to redesigned to allow for some sort of async update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a TODO, what should be done and can it be completed before merging the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put that ToDo for another time. I am not using menus myself and not sure how it works, but when you look at the code it would require a rework to avoid delaying and a looping to fetch updates until the devices applies changes.
Too big refactor for now.
With this PR I am trying to fix the rather critical issue introduced last time.
@@ -74,7 +74,7 @@ public XMLConnection(String host) { | |||
connection.setRequestMethod("POST"); | |||
connection.setRequestProperty("Content-Length", Integer.toString(message.length())); | |||
|
|||
connection.setConnectTimeout(5); // set a timeout in case the device is not reachable (went offline) | |||
connection.setConnectTimeout(5000); // set a timeout in case the device is not reachable (went offline) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be constant, that could be a good place to include the unit in the name, because I hope that is milliseconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is milliseconds. This is the crux of the fix. Before I thought these were seconds (wanted 5 seconds).
Sure, a constant could be done added.
Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com>
Travis tests were successfulHey @zarusz, |
Hi @martinvw I incorporated the feedback. Please let me know if I need to do anything particular for this to ends up in the 2.5.2 release. |
…b#6835) Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com>
…b#6835) Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com> Signed-off-by: Tim Roberts <timmarkroberts@gmail.com>
…b#6835) Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com> Signed-off-by: leluna <hengrui.jiang@googlemail.com>
…b#6835) Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com> Signed-off-by: Hans-Reiner Hoffmann <hans-reiner.hoffmann@gmx.de>
…b#6835) Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com>
…b#6835) Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com>
…b#6835) Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com>
…b#6835) Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com>
Fixes #6328
As per #6328 and thread here community tested on few devices and it seems to resolve the issue.
The jar build for testing is available here.
This is rebased against the 2.5.x branch, I hope this can get in as a 2.5.2 release (the bug is critical).