Skip to content

[AI] Fix timeout issue during connection establishment (#193) #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ic0ns
Copy link
Contributor

@ic0ns ic0ns commented Jun 26, 2025

Summary

  • Fixed issue where serverSocket.accept() was blocking indefinitely when no client connected
  • Added serverSocket.setSoTimeout() before the accept() call to ensure proper timeout handling
  • Added comprehensive test to verify the timeout behavior works correctly

Changes

  • Modified ServerTcpTransportHandler.initialize() to set socket timeout before accepting connections
  • Added testAcceptTimeout() test to verify that SocketTimeoutException is thrown when no client connects within the timeout period

Test Plan

  • Run existing tests: mvn test -Dtest=ServerTcpTransportHandlerTest - all tests pass
  • New test specifically verifies the timeout behavior
  • Code formatted with spotless: mvn spotless:apply

Fixes #193

Added serverSocket.setSoTimeout() before accept() call to prevent
indefinite blocking when no client connects. This ensures the server
times out appropriately and throws a SocketTimeoutException.

- Set serverSocket timeout before calling accept()
- Added test to verify timeout behavior works correctly
- Fixes issue where server would hang indefinitely waiting for connections
@ic0ns ic0ns changed the title Fix timeout issue during connection establishment (#193) [AI] Fix timeout issue during connection establishment (#193) Jun 26, 2025
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.

Resolved Timeout Issue During Connection Establishment
1 participant