-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Updates for parallel processing #218
Updates for parallel processing #218
Conversation
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Codecov Report
@@ Coverage Diff @@
## main #218 +/- ##
==========================================
+ Coverage 97.15% 97.20% +0.05%
==========================================
Files 70 70
Lines 7579 7661 +82
==========================================
+ Hits 7363 7447 +84
+ Misses 165 164 -1
+ Partials 51 50 -1
Continue to review full report at Codecov.
|
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
aed3236
to
dcd0b7a
Compare
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
dcd0b7a
to
284c37c
Compare
# This is the 1st commit message: Add concurrency debug Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io> # This is the commit message hyperledger#2: Debug time in OnMessage Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
3eecec2
to
c4599ab
Compare
…g retry Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@@ -133,6 +150,25 @@ func (p *txnProcessor) Init(rpc eth.RPCClient) { | |||
if p.conf.HDWalletConf.URLTemplate != "" { | |||
p.hdwallet = newHDWallet(&p.conf.HDWalletConf) | |||
} | |||
p.concurrencySlots = make(chan bool, p.conf.SendConcurrency) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a discussion with @peterbroadhurst , I note that this needs to be setup in Init()
because of the way this function and the caller of this function NewKafkaBridge()
is called:
firefly-ethconnect/cmd/ethconnect.go
Lines 172 to 173 in 442cfb3
kafkaBridge := kafka.NewKafkaBridge(&dontPrintYaml) | |
kafkaBridge.SetConf(conf) |
The config is set after the constructor is invoked, so setting it in the constructor doesn't have the intended effect.
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Three related changes from analysis of some performance tests:
The
sendConcurrency
setting is not currently providing the full concurrency support it was intended to. This is because theconcurrencySlots
channel was being allocated in the constructor of theTxnProcessor
which is beforeSetConf
is called. So we need to allocated it inInit()
. This results in us using pipelining between theSend
and in-flight nonce allocation, but not performing multipleSend
calls in parallel.In the case that a
Send
fails due to an intermittent error, such as a timeout, this is problem for end-users because they do not know if the transaction was submitted or not. However, in cases where EthConnect is in control of thenonce
it is safe for EthConnect to retry. So this PR introduces an option for retries, and enables these by default (with a small number - 5) to deal with glitches without pushing those errors all the way back to the requester.Currently the addressbook lookup is performed on the single-threaded processing, before we dispatch a concurrent worker to the
inflight
action. As there is a JSON/RPC healthcheck call that is part of this (net_version
) this is inefficient. So this PR moves it to the concurrent worker, afterinflight
is generated.