Skip to content

Commit

Permalink
Merge pull request #750 from aklenik/fix-orderer-timeout
Browse files Browse the repository at this point in the history
Fix Fabric orderer error handling
  • Loading branch information
aklenik authored Mar 3, 2020
2 parents f19275a + 0a51d0e commit 2b77a1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions packages/caliper-fabric/lib/adaptor-versions/v1/fabric-v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -1826,10 +1826,13 @@ class Fabric extends BlockchainInterface {

broadcastResponse = await responsePromise;
} catch (err) {
// missing the ACK does not mean anything, the Tx could be already under ordering
// so let the events decide the final status, but log this error
// either an explicit deny from the orderer
// or a timeout occurred (eating up all the allocated time for the TX)
invokeStatus.Set(`broadcast_error_${targetOrderer}`, err.message);
logger.warn(`Broadcast error from ${targetOrderer}: ${err.message}`);
invokeStatus.SetVerification(true);

errors.push(new Error(`Broadcast error from ${targetOrderer}: ${err.message}`));
throw errors;
}

invokeStatus.Set('time_orderer_ack', Date.now());
Expand Down
9 changes: 6 additions & 3 deletions packages/caliper-fabric/lib/adaptor-versions/v2/fabric-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1826,10 +1826,13 @@ class Fabric extends BlockchainInterface {

broadcastResponse = await responsePromise;
} catch (err) {
// missing the ACK does not mean anything, the Tx could be already under ordering
// so let the events decide the final status, but log this error
// either an explicit deny from the orderer
// or a timeout occurred (eating up all the allocated time for the TX)
invokeStatus.Set(`broadcast_error_${targetOrderer}`, err.message);
logger.warn(`Broadcast error from ${targetOrderer}: ${err.message}`);
invokeStatus.SetVerification(true);

errors.push(new Error(`Broadcast error from ${targetOrderer}: ${err.message}`));
throw errors;
}

invokeStatus.Set('time_orderer_ack', Date.now());
Expand Down

0 comments on commit 2b77a1c

Please sign in to comment.