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

The viewer remains sometimes empty when running from IDE #2556

Closed
Tracked by #2779
abey79 opened this issue Jun 28, 2023 · 2 comments · Fixed by #2821
Closed
Tracked by #2779

The viewer remains sometimes empty when running from IDE #2556

abey79 opened this issue Jun 28, 2023 · 2 comments · Fixed by #2821
Assignees
Labels
😤 annoying Something in the UI / SDK is annoying to use 🪳 bug Something isn't working user-request This is a pressing issue for one of our users
Milestone

Comments

@abey79
Copy link
Member

abey79 commented Jun 28, 2023

This is a weird one: when running a simple script from an IDE, the viewer sometimes remains empty. I've experienced this repeated with PyCharm, and something similar has recently been reported by a Discord user using VSCode (discord convo).

I can reproduce with a certain reliability using this:

import time
import rerun as rr

rr.init("test", spawn=True)
#time.sleep(2)
rr.log_points("points", [(0, 0), (2, 2), (2, 2.5), (2.5, 2), (3, 4)], radii=0.5)

Uncommenting the sleep() call appears to reduce the rate of occurence.

I've never seen that when launching from the CLI, same for the discord user.

This resemble #2124, but is probably different, as the sleep call is before the logging call, rather than at the end. It's as if the viewer takes too long to start and the logged messages are dropped.

@abey79 abey79 added 🪳 bug Something isn't working 😤 annoying Something in the UI / SDK is annoying to use user-request This is a pressing issue for one of our users labels Jun 28, 2023
@Wumpf
Copy link
Member

Wumpf commented Jun 29, 2023

I'm seeing this issue more prominently when I stream to a file instead of connecting to a viewer - the first call (typically view_coordinates -.-) may be lost then.
Critical issue imho, nothing worse than loosing recording calls

@jleibs jleibs mentioned this issue Jul 24, 2023
11 tasks
@jleibs
Copy link
Member

jleibs commented Jul 24, 2023

We should investigate this before the release, but timebox the investigation.

@jleibs jleibs self-assigned this Jul 25, 2023
@abey79 abey79 added this to the 0.8 milestone Jul 25, 2023
jleibs added a commit that referenced this issue Jul 26, 2023
…pping data (#2821)

Resolves: #2556

### What
We've always had a race condition during startup where a viewer might
not exist despite a client trying to connect to it.

For users of spawn we could have added a bandaid here by probably
increasing this sleep:

https://github.com/rerun-io/rerun/blob/main/rerun_py/rerun_sdk/rerun/sinks.py#L180

This wouldn't resolve issues for other use-cases of manually launching a
viewer and client without tight orchestration.

Instead, we introduce a timeout (which can optionally be set to None),
to use during the disconnected checks when we are flushing. This gives
power-users the option to specify None and reduce risk of losing data
(at an increased risk of blocking during flush when things go wrong).

This PR also bumps a couple of debug logs up to warnings to make it more
clear when data is being dropped.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2821) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/2821)
- [Docs
preview](https://rerun.io/preview/pr%3Ajleibs%2Ftimeout_disconnects/docs)
- [Examples
preview](https://rerun.io/preview/pr%3Ajleibs%2Ftimeout_disconnects/examples)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😤 annoying Something in the UI / SDK is annoying to use 🪳 bug Something isn't working user-request This is a pressing issue for one of our users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants