perf(rpc): share one batch pool across the v8/v9/v10 servers - #4013
perf(rpc): share one batch pool across the v8/v9/v10 servers#4013NazariiDenha wants to merge 2 commits into
Conversation
|
Claude finished @NazariiDenha's task in 2m 34s —— View job Review: rpc: share one batch pool across v8/v9/v10 servers
Summary: The change is correct and does what it says. Concurrency safety: Backward compatibility: existing tests that call No blockers or important issues found. Nit: In |
PR Reviewer Guide 🔍(Review updated until commit 04f3242)Here are some key observations to aid the review process:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4013 +/- ##
==========================================
- Coverage 79.32% 79.21% -0.11%
==========================================
Files 465 465
Lines 35795 35802 +7
==========================================
- Hits 28393 28361 -32
- Misses 7393 7432 +39
Partials 9 9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@NazariiDenha commit lint please |
4d189b0 to
04f3242
Compare
|
Claude finished @NazariiDenha's task in 3m 36s —— View job Review: rpc: share one batch pool across v8/v9/v10 servers
Verdict: clean — no blockers or important issues. The change is correct: Concurrency/lifecycle check: I specifically verified the shared-pool-lifecycle concern raised by the automated PR-Agent review (that one server's Backward compatibility: confirmed via Build/vet: Nit (non-blocking): |
rodrodros
left a comment
There was a problem hiding this comment.
Open question. Should the default max go-routines also increase?
Probably, not. As I tested in benchmarks: pool begins to show maximum performance on relatively small concurrency values (4-8) even on machine with 16 cores. So even on machine with minimum requirements of 4 cores we will have 8 by default |
|
Persistent review updated to latest commit 04f3242 |
| } | ||
|
|
||
| // NewServer instantiates a JSONRPC server | ||
| func NewServer(poolMaxGoroutines int, logger log.StructuredLogger) *Server { |
There was a problem hiding this comment.
I think this is minimal change, but I'm wondering if we should pass the pool here, because it's required here.
There was a problem hiding this comment.
I decided to go with WithPool to be consistent with other fields in Server
There was a problem hiding this comment.
I think it's not really consistent.
Other With* functions are setting the optional fields, and they don't need to be set in order to work correctly.
For this one, a nil pool is not working, so we need to set a random number for poolMaxGoroutines in order to satisfy the condition that NewServer returns a working instance, then we set it using WithPool to override the newly created pool. This can cause confusion where reader may try to modify the passed poolMaxGoroutines before realizing that it doesn't change anything at all.
There was a problem hiding this comment.
added NewServerWithPool(pool *pool.Pool, logger log.StructuredLogger) and removeed .WithPool
04f3242 to
d450a7f
Compare
|
Claude finished @NazariiDenha's task in 3m 26s —— View job Review: share batch pool across v8/v9/v10 servers
Verdict: clean, no blockers or important issues. Re-reviewed the current head ( Concurrency check confirmed safe: each batch tracks its own tasks with a local Verified Nits (non-blocking, already raised in earlier review passes, no action needed):
|
Standalone PR ReviewPR-Agent could not safely update the persistent review. This standalone result will not replace the canonical review. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
d450a7f to
a43a4f8
Compare
|
Claude finished @NazariiDenha's task in 9m 17s —— View job Review: share batch pool across v8/v9/v10 servers
Verdict: no blockers or important issues. One nit posted inline. Re-reviewed the current head (
Concurrency check: confirmed safe. Each batch tracks its own tasks with a local Backward compatibility: confirmed — no existing test calls Build/vet: Nit (posted inline): the doc comment on the new |
Standalone PR ReviewPR-Agent could not safely update the persistent review. This standalone result will not replace the canonical review. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
| return s | ||
| } | ||
|
|
||
| // NewServer instantiates a JSONRPC server with pool |
There was a problem hiding this comment.
Doc comment still says "NewServer" — leftover from before the WithPool→NewServerWithPool rename. Should read // NewServerWithPool instantiates a JSONRPC server with a shared pool (staticcheck's ST1020 convention expects the comment to start with the function name).
| // NewServer instantiates a JSONRPC server with pool | |
| // NewServerWithPool instantiates a JSONRPC server with a shared pool |
User description
share one batch pool across the v8/v9/v10 servers
PR Type
Enhancement
Description
Share one goroutine pool across RPC versions
Add server constructor accepting explicit pool
Update batch concurrency help text
File Walkthrough
juno.go
Update batch concurrency usage textcmd/juno/juno.go
rpcBatchConcurrencyUsagehelp text.server.go
Add JSONRPC server constructor with pooljsonrpc/server.go
NewServerWithPoolconstructor.NewServerbehavior.node.go
Create shared batch pool for RPC serversnode/node.go
pool.Poolfor batch requests.poolimport fromconc.