Repository navigation
Keep warm frp work connections for bb connect next - #6207
Merged
Merged
Conversation
buildFrpcConfig never set transport.poolCount, so frps held no idle work connections: each request beyond the vhost proxy's 5 idle connections waited for a ReqWorkConn round trip, and the replenish requests from a burst overflowed the poolCount+10 channel, which frpc logged as "work connection pool is full, discarding". Request 10 pooled connections, the gate's maxPoolCount. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
buildFrpcConfig(packages/frp-client/src/config.ts) never settransport.poolCount, so it defaulted to 0 and frps kept no idle work connections for bb connect next. In frp v0.71.0 (the version pinned inpackages/tunnel-contract/src/next.ts),server/control.goGetWorkConnhandles an empty pool by sendingReqWorkConnand waiting for frpc to dial a connection, which costs an extra round trip. After every take it sends anotherReqWorkConnto replenish. frps's vhost HTTP proxy keeps onlyMaxIdleConnsPerHost: 5, so a burst of more than 5 parallel requests needs new work connections. One example is the web app refetching every active query when a tab resumes. Each of those requests waits a round trip, and the replenish requests then overflow thepoolCount + 10work-conn channel.RegisterWorkConnrejects the extra connections, and frpc logs this asStartWorkConn contains error: work connection pool is full, discarding. The user's server log showed 16–21 of these per burst on 2026-10-23.What changed
buildFrpcConfignow setstransport.poolCount: 10. That is the gate'smaxPoolCount(apps/connect-next/src/frps.ts), so frps uses the full value instead of clamping it. frps now pre-requests 10 work connections at login and keeps the pool full, and the channel capacity grows to 20, which covers the bursts we observed. frp multiplexes work connections as streams over the existing control connection by default, so idle pooled connections are cheap.infolevel (packages/frp-client/src/supervisor.tsonLine). Fewer of these lines should appear now, and lowering the level for one benign message doesn't seem worth a special case.How you verified
pnpm exec turbo run test typecheck --filter=@bb/frp-client --filter=./plugins/connect-next: all passing (frp-client 40 tests; connect-next 28 tests, includingfrp-e2e.test.ts, which launches the real frps/frpc binaries with the generated config and tunnels requests through it).packages/frp-client/test/config.test.ts.🤖 Generated with Claude Code