Skip to content

Commit

Permalink
Increase restart timeout (#1242)
Browse files Browse the repository at this point in the history
### Description

Increase stream reconnect timeout and silence reconnect exception

### Context


### Testing

- `./gradlew test`


### Documentation



### Known limitations
  • Loading branch information
Ifropc authored Dec 22, 2023
1 parent 3a0d2d3 commit 5c56c48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ subprojects {

allprojects {
group = "org.stellar.anchor-sdk"
version = "1.2.20"
version = "1.2.21"

tasks.jar {
manifest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ public void onFailure(
java.util.Optional<Throwable> error, java.util.Optional<Integer> responseCode) {
handleFailure(error);
}
});
},
SILENCE_TIMEOUT * 1000);
}

private void updateReceivedMetrics(OperationResponse operationResponse) {
Expand Down Expand Up @@ -429,6 +430,12 @@ void handleEvent(OperationResponse operationResponse) {
void handleFailure(Optional<Throwable> exception) {
// The SSEStreamer has internal errors. We will give up and let the container
// manager to restart.
if (exception.isPresent()
&& exception.get() instanceof IOException
&& exception.get().getMessage().contains("Canceled")) {
infoF("Restarting stream");
return;
}
exception.ifPresent(throwable -> errorEx("stellar payment observer stream error: ", throwable));
// Mark the observer unhealthy
setStatus(STREAM_ERROR);
Expand Down

0 comments on commit 5c56c48

Please sign in to comment.