Skip to content

Improve InstrumentProvider error handling when loading #2444

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

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

davidsblom
Copy link
Member

Pull Request

Catch Exceptions when loading the instruments.

This is a follow up from #2437. The state variable self._loading needs to be reset to False. Hence, the previous fix still resulted in the fact that the instruments were not being reloaded when a Bybit error occured.

Type of change

Delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested?

Live example

@cjdsellers
Copy link
Member

Hi @davidsblom

Thanks for the PR!

In this case is the Bybit error recoverable on a retry, and not a bug in the adapter?

@davidsblom
Copy link
Member Author

Sure, that would be another way to fix it. Right now, the Bybit adapter doesn't use a retry manager. We could do that too if you prefer that.

@davidsblom davidsblom marked this pull request as draft March 12, 2025 19:52
@cjdsellers
Copy link
Member

I think this is a good change just because the provider clearly isn't loading anymore if it's handled an error and stopped processing the instruments.

I was thinking of a scenario where we're continually retrying on a bug, but I don't think that's the case here?

@davidsblom
Copy link
Member Author

The Bybit adapter should try every hour to fetch the instruments. As of now, there is no retry manager used in case of http errors. This fix just logs the error, and then one hour later the instruments are fetched again.

Could follow up with a retry manager for the Bybit adapter.

@davidsblom davidsblom marked this pull request as ready for review March 12, 2025 20:12
@cjdsellers cjdsellers changed the title Catch Exceptions when loading the instruments Improve InstrumentProvider error handling when loading Mar 12, 2025
@cjdsellers cjdsellers merged commit bffc94e into develop Mar 12, 2025
12 checks passed
@cjdsellers cjdsellers deleted the provider-instruments branch March 12, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants