finos / symphony-bdk-java

The Symphony BDK (Bot Developer Kit) for Java helps you to create production-grade Chat Bots and Extension Applications on top of the Symphony REST APIs.
https://symphony-bdk-java.finos.org
Apache License 2.0
23 stars 69 forks source link

Disable Connection Retry on Error 400 #530

Closed ystxn closed 3 years ago

ystxn commented 3 years ago

Bug Report

Steps to Reproduce:

Expected Result:

Throw exception and do not retry

Actual Result:

Exception thrown, but call is retried 2 more times with no opportunity to catch the retries Logs suggest that errors have occurred although the behaviour is expected

2021-06-02 06:06:40.192 ERROR 1 --- [       Thread-1] c.s.bdk.core.retry.RetryWithRecovery     : An unknown error occurred while trying to connect to https://develop2.symphony.com:443/pod. Please check below for more information: {"code":400,"message":"Stream not found."}
2021-06-02 06:06:41.257 ERROR 1 --- [       Thread-3] c.s.bdk.core.retry.RetryWithRecovery     : An unknown error occurred while trying to connect to https://develop2.symphony.com:443/pod. Please check below for more information: {"code":400,"message":"Stream not found."}

Environment:

v2.1.7

Additional Context:

symphony-youri commented 3 years ago

Hi @ystan-

I checked with the latest version of the BDK, calling listRoomMembers with an invalid stream id and only got one call maybe and no retry attempts.

Are you sure this is the same request that is retried (the thread id is different in the logs)?

ystxn commented 3 years ago

Hey @symphony-youri you are right. Sorry, my bad. I was confused with the ERROR level log still being printed from the RetryWithRecovery class while I had explicitly caught both exceptions.