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

[homematic] Solves stability issues with HmIP devices #7902

Merged
merged 3 commits into from
Jun 12, 2020
Merged

[homematic] Solves stability issues with HmIP devices #7902

merged 3 commits into from
Jun 12, 2020

Conversation

MHerbst
Copy link
Contributor

@MHerbst MHerbst commented Jun 12, 2020

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoided.

Fixes #7762

Signed-off-by: Martin Herbst [email protected]

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoide.

Fixes #7762

Signed-off-by: Martin Herbst <[email protected]>
@MHerbst MHerbst requested a review from gerrieg as a code owner June 12, 2020 08:37
@TravisBuddy
Copy link

Travis tests were successful

Hey @MHerbst,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

return new RpcResponseParser(request).parse(data);
} catch (UnknownRpcFailureException | UnknownParameterSetException ex) {
throw ex;
} catch (Exception ex) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it absolutely necessary to catch Exception here?

*/
private synchronized Object[] sendMessage(int port, RpcRequest<String> request, int rpcRetryCounter)
throws IOException {
private byte[] send(int port, RpcRequest<String> request) throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

Please do not throw Exception, either define your own like HomematicException extends Exception or use something like IllegalStateException (or what fits best) and catch only that one. The problem with catchin Exception is that it hides programming errors like NPE.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with you regarding the catching and throwing of "Exception", but I tried to stay close to the original implementation and Jetty throws a lot of different exceptions. Will try to get rid of the Exception.

Signed-off-by: Martin Herbst <[email protected]>
@TravisBuddy
Copy link

Travis tests were successful

Hey @MHerbst,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

} else {
logger.warn("Non-blocking XmlRpcRequest failed, status code: {} / request: {}", httpStatus,
request);
resp.abort(new Exception());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
resp.abort(new Exception());
resp.abort(new IOException());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Martin Herbst <[email protected]>
@TravisBuddy
Copy link

Travis tests were successful

Hey @MHerbst,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@J-N-K J-N-K merged commit daa8d2b into openhab:2.5.x Jun 12, 2020
@cpmeister cpmeister added this to the 2.5.6 milestone Jun 12, 2020
@cpmeister cpmeister added the bug An unexpected problem or unintended behavior of an add-on label Jun 12, 2020
@MHerbst MHerbst deleted the issue-7762 branch June 13, 2020 09:10
knikhilwiz pushed a commit to knikhilwiz/openhab2-addons that referenced this pull request Jul 12, 2020
* Solves stability issues with HmIP devices

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoide.

Fixes openhab#7762

Signed-off-by: Martin Herbst <[email protected]>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
* Solves stability issues with HmIP devices

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoide.

Fixes openhab#7762

Signed-off-by: Martin Herbst <[email protected]>
Signed-off-by: CSchlipp <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Solves stability issues with HmIP devices

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoide.

Fixes openhab#7762

Signed-off-by: Martin Herbst <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Solves stability issues with HmIP devices

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoide.

Fixes openhab#7762

Signed-off-by: Martin Herbst <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Solves stability issues with HmIP devices

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoide.

Fixes openhab#7762

Signed-off-by: Martin Herbst <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Solves stability issues with HmIP devices

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoide.

Fixes openhab#7762

Signed-off-by: Martin Herbst <[email protected]>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
* Solves stability issues with HmIP devices

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoide.

Fixes openhab#7762

Signed-off-by: Martin Herbst <[email protected]>
Signed-off-by: Daan Meijer <[email protected]>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
* Solves stability issues with HmIP devices

The CCU gets unresponsive if several HmIP devices are installed and
always "non-blocking" requests are used. By reducing the use to what is
absolutely necessary, the problem can be avoide.

Fixes openhab#7762

Signed-off-by: Martin Herbst <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[homematic ipwired] No function after a few days
4 participants