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

Websocket: Simplify the connectionMonitor #1502

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Beadko
Copy link
Contributor

@Beadko Beadko commented Mar 11, 2024

PR Description

Currently, the WebSocket connectionMonitor is adding concurrency within the function. According to google styleguide, the caller should add the concurrency to the function.

Fixes # (issue)

Type of change

Please delete options that are not relevant and add an x in [] as item is complete.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and
also consider improving test coverage whilst working on a certain feature or package.

  • go test ./... -race
  • golangci-lint run
  • TestConnectionMonitor

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally and on Github Actions with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 37.74%. Comparing base (d518993) to head (ba36511).
Report is 42 commits behind head on master.

Current head ba36511 differs from pull request most recent head 0ce5d4b

Please upload reports for the commit 0ce5d4b to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1502      +/-   ##
==========================================
- Coverage   37.75%   37.74%   -0.02%     
==========================================
  Files         411      411              
  Lines      147817   147804      -13     
==========================================
- Hits        55815    55794      -21     
- Misses      84218    84219       +1     
- Partials     7784     7791       +7     
Files Coverage Δ
exchanges/stream/websocket.go 87.19% <66.66%> (+1.14%) ⬆️

... and 10 files with indirect coverage changes

Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Beadko Fine work. This is a much better approach. Just some nits and feedback.

exchanges/stream/websocket.go Show resolved Hide resolved
exchanges/stream/websocket.go Outdated Show resolved Hide resolved
@shazbert shazbert added the review me This pull request is ready for review label Mar 11, 2024
@shazbert shazbert added reconstructing Based on PR feedback, this is currently being reworked and is not to be merged and removed review me This pull request is ready for review labels Mar 12, 2024
@thrasher- thrasher- added review me This pull request is ready for review and removed reconstructing Based on PR feedback, this is currently being reworked and is not to be merged labels Mar 20, 2024
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Beadko Just waiting on these changes that was laid out from gk

@shazbert shazbert added reconstructing Based on PR feedback, this is currently being reworked and is not to be merged and removed review me This pull request is ready for review labels Mar 20, 2024
It should be the choice of the caller whether a routine is in a goro.
Removes state tracking and instead ensures that the dataMonitor dies with the websocket
It should be the choice of the caller whether a routine is in a goro.
Removes state tracking and instead ensures that the trafficMonitor dies with the websocket
@Beadko Beadko requested a review from shazbert March 29, 2024 03:45
@shazbert shazbert added review me This pull request is ready for review and removed reconstructing Based on PR feedback, this is currently being reworked and is not to be merged labels Apr 15, 2024
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, this is deadlocked by dataMonitor not being called in a go routine. Please update and retest. Once that is updated it then it looks good to go.

@shazbert shazbert added reconstructing Based on PR feedback, this is currently being reworked and is not to be merged and removed review me This pull request is ready for review labels Apr 15, 2024
@shazbert shazbert added review me This pull request is ready for review and removed reconstructing Based on PR feedback, this is currently being reworked and is not to be merged labels May 6, 2024
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing removing the deadlock. There some more things that need to be done and then it should be good to go. Well done.

There are some race issues in the ci build

exchanges/stream/websocket.go Outdated Show resolved Hide resolved
exchanges/stream/websocket.go Outdated Show resolved Hide resolved
exchanges/stream/websocket.go Outdated Show resolved Hide resolved
exchanges/stream/websocket.go Show resolved Hide resolved
@shazbert shazbert added reconstructing Based on PR feedback, this is currently being reworked and is not to be merged and removed review me This pull request is ready for review labels May 6, 2024
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, there is a deadlock introduced in the tests. Then everything else looks good to go.

@Beadko Beadko requested a review from shazbert May 22, 2024 07:49
@shazbert shazbert added review me This pull request is ready for review and removed reconstructing Based on PR feedback, this is currently being reworked and is not to be merged builds require fixing labels May 23, 2024
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Beadko Nice clean! Thanks. tACK.

@shazbert shazbert added the szrc shazbert review complete label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review me This pull request is ready for review szrc shazbert review complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants