You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following steps take place during the Start call on a Chain object:
1. Creation of Kafka producer.
2. Posting of no-op CONNECT message to partition that corresponds to
channel.
3. Creation of Kafka consumer.
All of these steps need to succeed before we can have an OSN that can
write to and read from a channel.
This changeset:
1. Introduces a `retryProcess` concept, where a given function is
executed until it succeeds, following a short/long retry logic.
2. Turns each of the steps above into a `retryProcess`.
3. Moves all of the logic under the `Start` method into a goroutine so
as to minimize blocking; the expectation of the `multichain.Manager` is
that `Chain.Start` returns quickly.
4. Modifies `Enqueue` so that it returns false (which results in a
SERVICE_UNAVAILABLE response to the Broadcast call) when all retriable
steps above haven't completed successfully.
5. Makes the orderer panic if LongRetryTotal elapses.
This changeset also introduces some unit test changes, beyoned the ones
warranted by the production path changes described above, the main one
being the closing of some client objects that were leaking.
This changeset is part of fixing FAB-4136.
Change-Id: I2198e020affa56a877ba61a928aae6a45707524d
Signed-off-by: Kostas Christidis <[email protected]>
Copy file name to clipboardexpand all lines: bddtests/features/bootstrap.feature
+9-7
Original file line number
Diff line number
Diff line change
@@ -156,8 +156,10 @@ Feature: Bootstrap
156
156
157
157
And the user "dev0Org0" using cert alias "consortium1-cert" broadcasts ConfigUpdate Tx "configUpdateTx1" to orderer "<orderer0>" to create channel "com.acme.blockchain.jdoe.Channel1"
158
158
159
-
# Sleep as the local orderer ledger needs to create the block that corresponds to the start number of the seek request
160
-
And I wait "<BroadcastWaitTime>" seconds
159
+
# Sleep as the local orderer needs to bring up the resources that correspond to the new channel
160
+
# For the Kafka orderer, this includes setting up a producer and consumer for the channel's partition
161
+
# Requesting a deliver earlier may result in a SERVICE_UNAVAILABLE response and a connection drop
162
+
And I wait "<ChannelJoinDelay>" seconds
161
163
162
164
When user "dev0Org0" using cert alias "consortium1-cert" connects to deliver function on orderer "<orderer0>"
163
165
And user "dev0Org0" sends deliver a seek request on orderer "<orderer0>" with properties:
@@ -342,8 +344,8 @@ Feature: Bootstrap
342
344
# TODO: Once events are working, consider listen event listener as well.
logger.Debugf("[channel: %s] Retrying every %s for a total of %s", channel.topic(), retryOptions.ShortInterval.String(), retryOptions.ShortTotal.String())
434
-
deferrepeatTick.Stop()
435
-
deferpanicTick.Stop()
463
+
logger.Infof("[channel: %s] Setting up the producer for this channel...", channel.topic())
436
464
437
-
loop:
438
-
for {
439
-
select {
440
-
case<-panicTick.C:
441
-
returnnil, err
442
-
case<-repeatTick.C:
443
-
logger.Debugf("[channel: %s] Connecting to Kafka cluster: %s", channel.topic(), brokers)
0 commit comments