[Bug]: Relay socket dropped with code 1006 every few minutes while idle — no keepalive, no close reason logged
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- web-dev
- Domaine
- networking
Piste de recherche
Start by locating the relay-client WebSocket implementation and its close and reconnect handling; the issue does not name source files or tests. Check how the socket is kept alive and what close details are available, then trace how a relay disconnect affects connected clients. Done means idle connections stay registered, close details are diagnosable, and clients recover from a dropped link.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Platform
Linux
Operating system version
Debian 13 (standalone server, polyscope-server 0.29.0 running as a systemd unit)
System architecture
Intel (x86_64)
PolyScope Version
0.29.0
Bug description
The relay socket to relay-edge.getpolyscope.com is closed with code 1006 ("Connection ended") on a regular cycle, and it does this when the server is completely idle — no remote client attached, no agent running, nothing hitting the API.
From our log over ~3 days on one server:
[relay-client] Disconnected from relay (code: 1006, reason: Connection ended)
[relay-client] Reconnecting in 5s...
[relay-client] Connecting to relay at wss://relay-edge.getpolyscope.com...
[relay-client] Connected to relay
[relay-client] Registered as server <id>
- 589 such drops in the log
- 539 of 589 (91%) have no client request or diff work in the 40 log lines before them — i.e. the link was idle
- Average interval while idle: ~7 minutes (a separate stretch measured 119 drops over 3.8 days ≈ 45 min; the rate degrades over uptime)
The server itself is healthy the whole time: ~1.4% CPU, 105 MB RSS, no errors, no restarts, network path to the relay fine (TLS handshake and Registered as server succeed within ~4 s every time).
Two things I can see from the client side of this binary:
- There is no application-level keepalive. Searching the compiled relay-client code, there's no
setInterval, no ping/pong, no heartbeat around the relay socket — onlyReconnecting in Nsbackoff after a close. If the edge is reaping idle WebSockets, nothing on the server is holding it open. - The close reason is never logged. We get
code: 1006, reason: Connection endedand nothing else — no close frame from the edge, no distinguishing between idle timeout, edge restart and network death.1006means "no close frame received", so it's being cut underneath the client.
Impact: every drop kills the E2E session for whatever tabs are open. The tab shows a hung/blank page and only recovers on a manual reload — some of the time not even then. Users see "Polyscope has frozen" while the server is perfectly fine.
Steps to reproduce
- Run
polyscope-serverstandalone, signed in, relay connected. - Attach no remote clients and leave it completely idle.
- Watch the log:
Disconnected from relay (code: 1006, reason: Connection ended)arrives within minutes, then reconnects, then repeats indefinitely. - Alternatively watch the socket:
ss -tinp | grep 443 | grep polyscope— the source port rotates andlastsnd/lastrcvgo stale before each close.
Expected
- The relay client should send a WebSocket ping (or equivalent keepalive) at an interval shorter than the edge's idle timeout, so an idle server stays registered.
- Log the actual close code and any close-frame reason from the edge, so this is diagnosable from the server side without guessing.
- Connected clients should be told the link dropped (and re-establish) rather than showing a hung page.
Relevant log output
[relay-client] Connecting to relay at wss://relay-edge.getpolyscope.com...
[relay-client] Connected to relay
[relay-client] Registered as server <id>
[relay-client] Remote client connected: <uuid> (1 remote)
[relay-client] E2E established with client <uuid>
[relay-client] Remote client disconnected: <uuid> (0 remote)
[relay-client] Disconnected from relay (code: 1006, reason: Connection ended) <-- no client activity, link idle
[relay-client] Reconnecting in 5s...
[relay-client] Connecting to relay at wss://relay-edge.getpolyscope.com...
[relay-client] Connected to relay
[relay-client] Registered as server <id>
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 20
- Forks
- 0
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de beyondcode/polyscope-community
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
-
[Bug]: Remote branch selection uses an unresolved local branch name when creating a workspaceOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
needs information
Difficulté 3/5 1-2 jours Accessibilité débutants 52/100
beyondcode/polyscope-community#204 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 22/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
Toutes les issues de beyondcode/polyscope-community
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Sentinel discovery throws before connecting when CommandTimeout exceeds the .NET timer limitOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
thomhurst/Respire#2382 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 68/100
-
triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 2 jours
-
help wanted
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100