Skip to content

Comments

[network] Performance refactoring 5.0.x#19427

Merged
lsiepel merged 2 commits intoopenhab:5.0.xfrom
Nadahar:network-performance-refactoring-5.0.x
Oct 11, 2025
Merged

[network] Performance refactoring 5.0.x#19427
lsiepel merged 2 commits intoopenhab:5.0.xfrom
Nadahar:network-performance-refactoring-5.0.x

Conversation

@Nadahar
Copy link
Contributor

@Nadahar Nadahar commented Oct 3, 2025

This is a backport that combines #17972 and #19398

This probably shouldn't be squashed to retain the references to the original PRs.

lsiepel and others added 2 commits October 3, 2025 17:47
…nhab#17972)

* Fix performance
* Improvements
* Add logging
* Improve logging
* Update bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/NetworkUtils.java
* Improve thread handling
* Improve shutdown
* thread cleanup
* Improve per thread allocation
* Stop on finishing all interfaces
* Change Arping to make use of completeablefeature
* Seperate presence detection from lifecycle
* Improve logging and filtering
* Create seperate ScheduledExecutorService
* Fix review comment
* Improve network address checks
* Improve interrupthandling
* Revert threadlocal
* Refactor Presencedetection
* Make LatencyParser accept Windows' <1ms syntax for minimal latency
* Remove misleading reference to non-existing NetworkHandlerBuilder
* Handle thread-safety of NetworkDiscoveryService.executorService
* Fix network interface exclusion
* Make PresenceDetectionValue thread-safe
* Partial refactoring of PresenceDetection

Fixes:
  - Synchronization of lastSeen
  - Joining of async tasks
  - Minor logging improvements
Addition:
  - Create setIcmpPingMethod()

* Partial refactoring of NetworkDiscoveryService

Fixes:
  - Correct the number of addresses in a /24 subnet.
  - Restructure task creation so that one less thread is needed per scanned address, and so that startScan() is guaranteed to return quickly.
  - Create independent threads for posting discovery results, as this can take a long time and might not finish before the executor shuts down.

* Make NetworkHandler thread-safe
* Make SpeedTestHandler thread-safe
* Make sure that process output is consumed
* Implement tool-specific latency parsing
* Fix NetworkDiscoveryService configuration and make the thread pool size configurable
* i18n
* Fix test

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Co-authored-by: Wouter Born <github@maindrain.net>
Co-authored-by: Ravi Nadahar <nadahar@rediffmail.com>
…nhab#19398)

* Use a threaded consumer for Process output consumption

Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 3, 2025

@lsiepel I've created this for 5.0.x. My guess is that it will backport smoothly to 4.3.x too, but I can try to verify that.

Given #19398 (comment), I assume that we should let this PR hang around for a while. The big question is how to remember it when the time is due..?

@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 3, 2025

For some reason your signature fails the DCO check... but it probably doesn't matter.

@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 3, 2025

@lsiepel It didn't backport cleanly to 4.3.x, because #18083 hasn't been backported either. I figured that #18083 has been out for a while and can be considered "safe", and the changes it makes are important improvements IMO, so I simply included it as well in #19428. That meant that there were no conflicts, so it should work "smoothly".

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

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

Thanks, will backport later when no regressions have been found and prior to next patch release.

@jlaur
Copy link
Contributor

jlaur commented Oct 4, 2025

@Nadahar - did you simply cherry-pick the commits from those two PR's? In that case @lsiepel could cherry-pick them in the same order directly into 5.0x. There is no need for a PR. The "backported" label will need to be set on the PR's anyway so that they will be mentioned in the release notes.

@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 4, 2025

did you simply cherry-pick the commits from those two PR's? In that case @lsiepel could cherry-pick them in the same order directly into 5.0x. There is no need for a PR. The "backported" label will need to be set on the PR's anyway so that they will be mentioned in the release notes.

@jlaur I don't know your internal routines for backporting, release notes and all that. I did cherry-pick them, but I didn't know in advance if there would be conflicts or not. It turns out there were none, so yeah, technically this PR does very little. But, I've still done the cherry-picking - and why waste what has already been done? I chose to create the two PRs with the cherry-picks so that nobody else had to repeat it 😉

In this case, where we want to hold off the backports a bit to make sure there are no regressions, it might be easier to handle merging a couple of PR's than cherry-picking 5 commits (the situation is the same with #19428) in the correct order when the time is due?

This is all up to you guys and how you want to handle it, I'm just trying to make things easier.

@jlaur
Copy link
Contributor

jlaur commented Oct 4, 2025

I did cherry-pick them, but I didn't know in advance if there would be conflicts or not. It turns out there were none

It's all good, just wanted to double-check what this PR represents. 🙂

@lsiepel lsiepel merged commit b6a85d8 into openhab:5.0.x Oct 11, 2025
1 check passed
@lsiepel lsiepel modified the milestone: 5.1 Oct 11, 2025
@Nadahar Nadahar deleted the network-performance-refactoring-5.0.x branch October 14, 2025 19:54
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.

3 participants