finos/symphony-bdk-java

Retry is running when client error 403 happens

yinan-symphony opened this issue · 2 comments

Bug Report

When the bot is sending a list room members request (through streamService.listRoomMembers), if the bot is not in the room, the request should be rejected, and no retry should be triggered.

Steps to Reproduce:

  1. call list room members request to a room where the bot is not in

Expected Result:

request is rejected, no retry

Actual Result:

2021-12-02 11:43:55.754 CET
retry is triggered, here is the log

02 Dec 2021 10:43:55,754 ERROR [com.symphony.bdk.core.retry.RetryWithRecovery] (XNIO-1 task-8 - 16471) An unknown error occurred while trying to connect to https://XXX:443/pod. Please check below for more information: {"code":403,"message":"User XXX is neither an admin nor a member of the specified rooms"}
"
timestamp: "2021-12-02T10:43:55.754724151Z"
}

Environment:

Production

Additional Context:

...add any other context about the problem here. If applicable, add screenshots to help explain...

Hi @yinan-symphony

If the BDK retries then you should see a Retry in ... log.
By default the BDK retries on those conditions:

return apiException.isServerError() || apiException.isUnauthorized() || apiException.isTooManyRequestsError();

so it should not retry on 403 errors.

The error is indeed captured by the RetryWithRecovery logger which can be misleading.

thank you very much for your support @symphony-youri