Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[roq-binance] OrderAck was missing when HTTP response was HTML (instead of JSON) #293

Closed
thraneh opened this issue Oct 17, 2022 · 1 comment
Labels
bug Something isn't working high priority support
Milestone

Comments

@thraneh
Copy link
Contributor

thraneh commented Oct 17, 2022

Not all exceptions were handled during JSON parsing.

This manifested itself during Binance system maintenance when a HTML response is received instead of the expected JSON.

Previous action was to only log the exception and then disconnect the stream.

This issue will be used to verify the more general issue #292

@thraneh thraneh added bug Something isn't working high priority support labels Oct 17, 2022
@thraneh thraneh added this to the 0.8.9 milestone Oct 17, 2022
@thraneh
Copy link
Contributor Author

thraneh commented Oct 18, 2022

When receiving the HTTP 403 response code we not only receive HTML (instead of JSON), we also need to back off for some significant time. This is now managed by the connection manager from the roq-io library: a new suspend feature has been added.

The roq-binance gateway has some new flags:

  • --rest_back_off_delay is used to suspend a HTTP connection after having seen the 403 response code

The online documentation from Binance states that a back-off period of 5 minutes is required, this is also the default value for the --rest_back_off_delay flag.

  • --rest_terminate_on_403 can be used to terminate the gateway after seeing the 403 response code

Due to the complexity of the download procedure (refresh listen keys, multiple requests for open orders, etc.), it may be preferable to restart the gateway for some scenarios. This flag makes it possible.

@thraneh thraneh closed this as completed Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority support
Development

No branches or pull requests

1 participant