-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-4408] Add retry logic to Chain.Start steps
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 <kostas@christidis.io>
- Loading branch information
1 parent
cd44fba
commit 5dd2e33
Showing
7 changed files
with
513 additions
and
265 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.