Skip to content

fix(connect): avoid watch websocket read timeouts#33

Merged
robinbraemer merged 1 commit into
connectfrom
codex/watch-client-timeout
Jun 22, 2026
Merged

fix(connect): avoid watch websocket read timeouts#33
robinbraemer merged 1 commit into
connectfrom
codex/watch-client-timeout

Conversation

@robinbraemer

@robinbraemer robinbraemer commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a dedicated WatchService OkHttp client for the long-lived control WebSocket.
  • Keep the existing Connect auth and metadata interceptors on watch requests.
  • Disable the idle read timeout for the WatchService WebSocket and enable 30 second WebSocket pings so dead connections are still detected and recovered.
  • Use synthetic platform metadata in the regression test so it does not look tied to a current Minecraft/Paper version.

Context

Some servers were reconnecting with java.net.SocketTimeoutException: timeout (cause: java.net.SocketException: Socket closed) while WatchService was under pressure. The server side saw context canceled during auth/session setup after the client closed the WebSocket request.

A normal OkHttp read timeout is a poor fit for an idle long-lived WebSocket because no session proposal may arrive for a long time. The safer pairing is no idle read timeout plus WebSocket pings; OkHttp cancels the WebSocket and notifies failure if a pong is not received for the ping interval.

Test Plan

  • ./gradlew :core:test --tests com.minekube.connect.module.CommonModuleTest

@robinbraemer robinbraemer force-pushed the codex/watch-client-timeout branch from 92b048e to 7fc0415 Compare June 22, 2026 10:46
@robinbraemer robinbraemer merged commit fb578ed into connect Jun 22, 2026
1 check passed
@robinbraemer robinbraemer deleted the codex/watch-client-timeout branch June 22, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant