-
Notifications
You must be signed in to change notification settings - Fork 188
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
[Access] Properly handle subscription errors in data providers #7046
[Access] Properly handle subscription errors in data providers #7046
Conversation
Distinguish between `context.Canceled` errors originating from the streamer and those triggered by the DataProvider’s `Close()` method. Use `wasClosedByClient()` to suppress expected cancellations while propagating unexpected ones
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7046 +/- ##
=======================================
Coverage 41.25% 41.25%
=======================================
Files 2170 2170
Lines 190050 190098 +48
=======================================
+ Hits 78409 78429 +20
- Misses 105097 105123 +26
- Partials 6544 6546 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
After discussing with Yurii, we agreed to use a different approach here. |
As this will changed, will re-aprove final implementation
We use it to distinguish place where cxt.Canceled error comes from. Also, I refactored each data provider's Run() function. Now it's more readable and clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this refactor needed? can you point out the important changes, it's not clear to me
Hey. I updated PR's description. Added a context of what has been done and why. |
engine/access/rest/websockets/data_providers/account_statuses_provider.go
Outdated
Show resolved
Hide resolved
engine/access/rest/websockets/data_providers/account_statuses_provider.go
Outdated
Show resolved
Hide resolved
@peterargue I also pointed out the most important lines of code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first round of review - DONE! I have a few small comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
engine/access/rest/websockets/data_providers/account_statuses_provider.go
Outdated
Show resolved
Hide resolved
engine/access/rest/websockets/data_providers/account_statuses_provider.go
Outdated
Show resolved
Hide resolved
engine/access/rest/websockets/data_providers/events_provider.go
Outdated
Show resolved
Hide resolved
- Moved creation and start of subscription and streamer to Run() function instead of having it in constructor - Ged rid of ctx in constructor. Moved it to Run() function - Refactored the structure of the base provider
engine/access/rest/websockets/data_providers/account_statuses_provider.go
Outdated
Show resolved
Hide resolved
engine/access/rest/websockets/data_providers/account_statuses_provider.go
Outdated
Show resolved
Hide resolved
engine/access/rest/websockets/data_providers/account_statuses_provider.go
Show resolved
Hide resolved
engine/access/rest/websockets/data_providers/account_statuses_provider.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small improvement, then this is ready to merge
Originally, the description of the issue was like that
However, after a couple of discussions and work on that, I can conclude that the first 3 clauses are outdated and were removed from the implementation. The only thing we left is the refactoring and the fact that we start the ubscription after a Run() method has been called.
Closes #7040 #7047