rerun icon indicating copy to clipboard operation
rerun copied to clipboard

Extend connect API to handle Viewer's later start or reconnect

Open rgolovanov opened this issue 1 year ago • 1 comments

Currently, the workflow of the logger-viewer implies that the viewer is running before logging starts, otherwise, it will lead to data accumulation (see #6933 ) and never connect. In practice, it is important to have the ability to know whether connect to the viewer was successful or not and monitor connectivity status somehow.

Describe the solution you'd like

  • Extend C++ API to indicate whether connect is successful or not - this would allow users to implement logic which attempts to connect.
  • Extend C++ API to indicate that the Viewer has been disconnected - this would allow users to handle such cases and initiate reconnect.

New API interfaces would allow users to handle these cases:

  1. Viewer starts after logger: Logger could make periodical checks/attempts to connect and once it is connected, it will start logging.
  2. Connected Viewer is closed or restarted: Logger should somehow monitor connection status and switch to periodical checks if the Viewer was disconnected.

rgolovanov avatar Aug 07 '24 09:08 rgolovanov

I don't think this applies to the C++ sdk in particular and is rather an issue in all APIs

Wumpf avatar Aug 07 '24 13:08 Wumpf

This feature would be very useful. Currently the SDK does not even provide connection status that clients can use to handle this on their end.

alokpr avatar Sep 15 '25 16:09 alokpr

Hi, is this issue still active? Thanks.

WorstCodeWay avatar Nov 21 '25 07:11 WorstCodeWay

There is a server mode in rerun sdk. In such mode, we can later open a rerun viewer like, rerun --connect rerun+http://127.0.0.1:9876/proxy to connect to a exist rerun server. Note please, 127.0.0.1 should be your correct ip address rerun server running on.

This feature meets my need. Codes as following:

      // Parse address to extract host and port
      std::string host = "0.0.0.0";
      uint16_t port = 9876;

      auto result = rec_->serve_grpc(host, port);

Edit: Be careful, it looks like the memory usage of the Rerun server keeps increasing until it eventually OOMs.

WorstCodeWay avatar Nov 21 '25 07:11 WorstCodeWay