-
-
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
[deconz] Adjust thread name for web socket client #14343
Conversation
A counter is maybe not the best option because a new thread pool will be created each time the thing handler is initialized. |
Whatever the provided name, a new thread pool is created by OH core framework. In case thing UID is too big, we could first try with the thing ID. PS: I am asking myself if the created thread pool is released when the web socket client is abandoned. |
4815be1
to
8de6863
Compare
websocketID = "deconz-" + thing.getUID().getId(); | ||
} | ||
if (websocketID.length() > 20) { | ||
websocketID = "deconz"; |
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.
That's not a good idea. It should be unique, but repeatable. Maybe hash the full ID and take the last 6 bytes as hex (12 characters + deconz-
prefix makes a total of 19 characters). I doubt that we'll run into collisions with that and it's nicely reproducible.
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.
It is better if it is unique but not required.
But your idea consisting in hashing the UID is good.
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.
Done
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.
Wait a second...
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.
That is ok now
d51f766
to
d83deab
Compare
Awaiting a new method in core framework. |
Awaiting PR openhab/openhab-core#3359 to be merged to then update this PR |
d83deab
to
9e5c5b2
Compare
My initial analysis was wrong, there is no risk of IAE with the current code. |
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
9e5c5b2
to
c5453d1
Compare
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Laurent Garnier lg.hc@free.fr