Research: Ephemeral port exhaustion #630
This is a future task. A detailed description will be provided in the near future.
Please do not start working on this task without the detailed specification, as it may turn out to be a different direction than expected, which could reduce the chances of receiving a reward.
If you are interested in completing this task, please leave a comment here.
After that, feel free to contact me on Discord: tatianacharchian_07833.
💬 Comments (3)
Hello @AlexeySamosadov, thank you for your contribution. However, I'd suggest waiting for @libermans or @gmorgachev to give a detailed description of the task and expected results.
PR created: https://github.com/gonka-ai/gonka/pull/656
Adds HTTP client connection pooling to prevent ephemeral port exhaustion.
🔄 Auto-synced from Issue #630 every hour.
Ephemeral Port Exhaustion Analysis
Summary
Found several patterns that can cause ephemeral port exhaustion due to improper HTTP client usage and missing connection pooling configuration.
Critical Issues Found
1.
http.DefaultClientusage without pooling configFile:
internal/server/public/post_chat_handler.go:367handleTransferRequest)2.
http.Post()calls create new connections each timeFiles: -
internal/server/public/post_chat_handler.go:443- tokenization -internal/server/public/post_chat_handler.go:525- executor requests-
internal/validation/inference_validation.go:897- validation3.
NewHttpClient()lacks Transport configFile:
utils/http.go:14-18Only sets timeout, no connection pooling configuration.
4. mlnodeclient creates Client without pooling
File:
mlnodeclient/client.go:38-405. New clients created per health check
File:
internal/server/admin/setup_report.go:549,567Creates newhttp.Clientfor each health check call.6. No timeout in participant registration
File:
participant/participant_registration.go:160Recommended Fix
Create a shared HTTP client with proper Transport configuration:
Files Requiring Changes
utils/http.go- UpdateNewHttpClient()with Transport configinternal/server/public/post_chat_handler.go- Replacehttp.DefaultClientandhttp.Post()mlnodeclient/client.go- Add Transport configurationinternal/server/admin/setup_report.go- Reuse single clientparticipant/participant_registration.go- Use configured client with timeoutinternal/validation/inference_validation.go- Replacehttp.Post()