Skip to content

Commit 073a3b3

Browse files
committed
fix: advance node on server error in async execution
Signed-off-by: emiliyank <e.kadiyski@gmail.com>
1 parent 3064770 commit 073a3b3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sdk/src/main/java/com/hedera/hashgraph/sdk/Executable.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,19 @@ private void executeAsyncInternal(
788788

789789
switch (executionState) {
790790
case SERVER_ERROR:
791+
advanceRequest();
792+
if (status == com.hedera.hashgraph.sdk.Status.INVALID_NODE_ACCOUNT) {
793+
if (logger.isEnabledForLevel(LogLevel.TRACE)) {
794+
logger.trace(
795+
"Received INVALID_NODE_ACCOUNT; updating address book and marking node {} as unhealthy, attempt #{}",
796+
grpcRequest.getNode().getAccountId(),
797+
attempt);
798+
}
799+
// Schedule async address book update
800+
client.updateNetworkFromAddressBook();
801+
// Mark this node as unhealthy
802+
client.network.increaseBackoff(grpcRequest.getNode());
803+
}
791804
executeAsyncInternal(
792805
client,
793806
attempt + 1,

0 commit comments

Comments
 (0)