Implement long poll for interactive login #306

Closed
opened 2025-12-29 01:26:26 +01:00 by adam · 3 comments
Owner

Originally created by @juanfont on GitHub (Aug 11, 2022).

When using interactive login (i.e., the web + CLI or OIDC) for client registration, clients expect the control server to enter in a long poll until the client gets registered. This is shown in the mock control server tailscale has for testing https://github.com/tailscale/tailscale/blob/v1.28.0/tstest/integration/testcontrol/testcontrol.go#L451

If this long polling is not followed (or, as we are doing, an immediate response is given), the client will immediately retry... ad infinitum - hammering headscale with requests.

This is what is happening in #603 and #706.

The long-term solution is to implement some basic long poll here, that holds the request until the registration occurs (or the client closed the connection).

Originally created by @juanfont on GitHub (Aug 11, 2022). When using interactive login (i.e., the web + CLI or OIDC) for client registration, clients expect the control server to enter in a long poll until the client gets registered. This is shown in the mock control server tailscale has for testing https://github.com/tailscale/tailscale/blob/v1.28.0/tstest/integration/testcontrol/testcontrol.go#L451 If this long polling is not followed (or, as we are doing, an immediate response is given), the client will immediately retry... _ad infinitum_ - hammering headscale with requests. This is what is happening in #603 and #706. The long-term solution is to implement some basic long poll here, that holds the request until the registration occurs (or the client closed the connection).
adam added the enhancementstale labels 2025-12-29 01:26:26 +01:00
adam closed this issue 2025-12-29 01:26:27 +01:00
Author
Owner

@juanfont commented on GitHub (Aug 11, 2022):

I have included a temporary solution in e1e3feb6a8

(should a bit help in #603 and #706)

@juanfont commented on GitHub (Aug 11, 2022): I have included a temporary solution in https://github.com/juanfont/headscale/pull/725/commits/e1e3feb6a810664c43ba5096c476a32a1dcab87c (should a bit help in #603 and #706)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 2, 2023):

This issue is stale because it has been open for 180 days with no activity.

@github-actions[bot] commented on GitHub (Oct 2, 2023): This issue is stale because it has been open for 180 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 16, 2023):

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions[bot] commented on GitHub (Oct 16, 2023): This issue was closed because it has been inactive for 14 days since being marked as stale.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#306