Service requests have no timeout and can hang forever #5

Closed
opened 2026-09-25 11:43:40 +00:00 by selimaj-dev · 0 comments
Owner

Problem

None of the ServiceClient requests has a timeout:

  • getPlayer does a bare session.request(...).join() on the SaturnPlayer-Worker thread
  • authenticate does session.request(ServiceMethods.Authenticate, ...).get()

If a response never arrives (the session-java send-then-register race, or a server that stopped answering), these block forever:

  • a stuck getPlayer freezes the player-fetch worker for the rest of the game, so no other player's cosmetics ever load
  • a stuck authenticate leaves the client unauthenticated without ever logging a failure

Fix

  • Add a timeout to every request, e.g. .orTimeout(10, TimeUnit.SECONDS) before join() / get(), and handle TimeoutException. For getPlayer, treat a timeout as "unknown, retry later" rather than "not a Saturn user".
  • Pick up the fixed session-java release once selimaj-dev/session-java#1 lands.
## Problem None of the `ServiceClient` requests has a timeout: - `getPlayer` does a bare `session.request(...).join()` on the `SaturnPlayer-Worker` thread - `authenticate` does `session.request(ServiceMethods.Authenticate, ...).get()` If a response never arrives (the `session-java` send-then-register race, or a server that stopped answering), these block forever: - a stuck `getPlayer` freezes the player-fetch worker for the rest of the game, so no other player's cosmetics ever load - a stuck `authenticate` leaves the client unauthenticated without ever logging a failure ## Fix - Add a timeout to every request, e.g. `.orTimeout(10, TimeUnit.SECONDS)` before `join()` / `get()`, and handle `TimeoutException`. For `getPlayer`, treat a timeout as "unknown, retry later" rather than "not a Saturn user". - Pick up the fixed `session-java` release once selimaj-dev/session-java#1 lands.
Sign in to join this conversation.