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

bug: Ping service: Is creating pings with same port #1200

Closed
1 task done
patrickelectric opened this issue Oct 26, 2022 · 5 comments · Fixed by #2354
Closed
1 task done

bug: Ping service: Is creating pings with same port #1200

patrickelectric opened this issue Oct 26, 2022 · 5 comments · Fixed by #2354
Assignees
Labels
bug Something isn't working ui User Interface feature

Comments

@patrickelectric
Copy link
Member

Bug description

image

Steps to reproduce

Connect two pings and a ping360

Primary pain point(s)

The UI does not make sense and it's not possible to know which sensor is being used

Prerequisites

  • I have checked to make sure that a similar request has not already been filed or fixed.
@patrickelectric patrickelectric added bug Something isn't working ui User Interface feature labels Oct 26, 2022
@Williangalvani
Copy link
Member

that is interesting. I wonder if bridges is stopping and that is causing the port to be identified as unused.

Can you share the log file?

@patrickelectric
Copy link
Member Author

It was a report from manufacture, they are going to get in touch

@ES-Alexander
Copy link
Collaborator

Also raised in this forum post - I've asked for a log.

Since it's async, I suspect the driver is likely starting to detect the next device before the previous device is counted as registered in the OS. @Williangalvani not sure if you've got some idea how to fix/avoid that.

@ES-Alexander
Copy link
Collaborator

This has been raised again, but I've also realised a possible cause, and thought of some ideas for potentially fixing it:

... my suspicion is that the asynchronous port searching means both device connections find the same UDP port before either of them is fully connected to it (in a race condition), and then they end up sharing the connection.

That may be preventable with a well-placed sleep, or perhaps by making the port connection process raise an error if multiple connections are made to the same port, and/or treatable by adding duplicate-port detection to the ping service and making it restart relevant device connections when port sharing is detected.

@ES-Alexander
Copy link
Collaborator

It may also be worth just storing a set of known used ports as a blacklist, since I imagine Python's variables will update faster than a port connection does. It's more important to have unique ports than to always have the same / consistent ports, so if we use a blacklist + port connection checking then that may be sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ui User Interface feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants