Skip to content

feat(wstransport): support concurrent accept (v2)#1937

Draft
fcecin wants to merge 1 commit intomasterfrom
feat/wstransport-concurrent-accept-v2
Draft

feat(wstransport): support concurrent accept (v2)#1937
fcecin wants to merge 1 commit intomasterfrom
feat/wstransport-concurrent-accept-v2

Conversation

@fcecin
Copy link
Collaborator

@fcecin fcecin commented Dec 5, 2025

NOTE: This is a draft PR; it depends on status-im/nim-websock#181 and addresses bug logos-messaging/logos-delivery#3634.

Rationale

Same as for the previous PR that aimed to address the same issue.

Proposed solution

The solution is to spawn a connection accept dispatcher task as part of WsTransport start.

The dispatcher task is responsible for pulling client sockets out via the new HttpServer.acceptStream, which is less problematic than attempting to multitask the StreamServer.accept from Chronos.

Once a client stream is read, HTTP header validation and timeout is parallelized by asyncSpawn'ing tasks to call HttpServer.processHttpRequest for each incoming client connection.

Changes

* use HttpServer.acceptStream and HttpServer.processHttpRequest
for concurrent accept (depends on: status-im/nim-websock#181)
* set DefaultConcurrentAccepts to 200 connections
* fix parallel streaming data test
* remove use of deprecated handshakeTimeout HttpServer param
@fcecin fcecin changed the title feat(wstransport): support concurrent accept in WsTransport (v2) feat(wstransport): support concurrent accept (v2) Dec 5, 2025
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 86.92308% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.60%. Comparing base (0b3a7e0) to head (44557cc).

Files with missing lines Patch % Lines
libp2p/transports/wstransport.nim 86.92% 17 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1937      +/-   ##
==========================================
- Coverage   83.68%   83.60%   -0.08%     
==========================================
  Files         145      145              
  Lines       23830    23868      +38     
  Branches       12       12              
==========================================
+ Hits        19941    19954      +13     
- Misses       3889     3914      +25     
Files with missing lines Coverage Δ
libp2p/transports/wstransport.nim 85.11% <86.92%> (+0.30%) ⬆️

... and 68 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fcecin
Copy link
Collaborator Author

fcecin commented Dec 5, 2025

About the CI failures, I think the performance.yml and interop.yml workflows might not be pulling deps from .pinned, which is why they fail to see the new processHttpRequest proc from the pinned nim-websock commit.

@richard-ramos richard-ramos moved this from new to In Progress in nim-libp2p Jan 15, 2026
@richard-ramos richard-ramos moved this from In Progress to In progress (outside the team) in nim-libp2p Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress (not by P2P team)

Development

Successfully merging this pull request may close these issues.

3 participants