Skip to content

[Refactor] Stop mechanism missing in PollingLoop utility #2921

@Codimow

Description

@Codimow

Describe the bug

The startPolling utility in PollingLoop.ts initiates a recursive setTimeout loop but provides no way to stop it. This causes tasks like
PrivilegeRefresher or Matchmaking to continue polling forever even when the component is logically destroyed or when the server is shutting down.

To Reproduce:

1.Call startPolling with a task.
2.Attempt to stop the polling when it's no longer needed (e.g., during worker shutdown).
3.Observe that the polling continues indefinitely.

Expected behavior:
startPolling
should return a "stop" function or a handle that allows cancellation of the loop.

Desktop:

OS: Arch
Browser: Firefox
Version: Latest
Additional context Affected file:
src/server/PollingLoop.ts

This prevents clean shutdowns and dynamic resource management.
This was sadly introduced by me

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDevopsInfrastructure, CI/CD, dependencies, and maintenance.

    Type

    No fields configured for Bug.

    Projects

    Status

    Pre-Development

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions