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: App floods the network trying to connect to every IP it's ever seen on a robot #5250

Closed
SyntaxColoring opened this issue Mar 19, 2020 · 1 comment · Fixed by #6193
Closed
Labels
app Affects the `app` project bug

Comments

@SyntaxColoring
Copy link
Contributor

SyntaxColoring commented Mar 19, 2020

Overview

When the Opentrons App opens, it tries to reach out to all previously discovered robots by their IP address. This causes significant ongoing network traffic, as the first TCP packet of each connection is retried ad infinitum.

Details

I found, through Wireshark:

  • 54% of my network traffic was TCP retransmissions from the app.
  • Only a handful of those retransmissions were legitimate. The rest were trying to establish connections to IP addresses that didn't exist. (Most weren't even on the right subnet.)
  • They were all going to port 31950.
  • The retransmissions did not stop within 5 minutes.

Clearing discovery.json in the app directory alleviates the problem.

Expected behavior

I don't think the app needs to call out to robots by their IP like this. In theory, this is what mDNS is for. Plus, in practice, dynamic IPs limit the usefulness of the strategy.

Of course, the app should still attempt to connect to IPs explicitly added in the advanced settings.

If we really do want this behavior, then there should be a fairly short timeout.

See also?

@SyntaxColoring SyntaxColoring added bug app Affects the `app` project labels Mar 19, 2020
@SyntaxColoring
Copy link
Contributor Author

SyntaxColoring commented May 3, 2020

Per discussion with @mcous:

This is intentional behavior and is the app sending HTTP GET requests to those IP addresses’ /health and /server/health endpoints. mDNS is for finding out what the IP address is, these health polls are for finding out if the robot is healthy and how to display it in the list.

As we know, mDNS can be quite slow, so waiting for a mDNS advertisement to display a robot in the list results in the list taking a really long time to display robots. This is how we used to do things before the Discovery Client was written, and it wasn’t great

In practice IP addresses on Wi-Fi networks tend to be stable for at least 24 hours

We think that the real problem is that IPs are cached forever. Limiting the cache period is ticketed separately. See the "See also" section above.

Closing this as wontfix, since we don't think the network spam is functionally disruptive. If you're a user and this is causing problems on your network, let us know, and we can reconsider. Changed our mind. We're leaving this open for now. The robot discovery cache is getting some improvements. Also, we will soon have the means to filter these requests by subnet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Affects the `app` project bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants