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

kv-client: fix stream is not recycled when meeting recv error #1336

Merged
merged 8 commits into from Jan 28, 2021

Conversation

amyangfei
Copy link
Contributor

What problem does this PR solve?

  • Find a but that gRPC stream is not recycled correctly in some scenarios
    • if stream.Recv with error, but the underlying stream is normal actually (or the next round of stream.Send is successfully, then the receiveFromStream goroutine will be never created, and corresponding events will not be consumed by kv client.
  • Improve unit test of kv client, part of Improve unit tests of kv client #1292

What is changed and how it works?

  • Close stream before receiveFromStream routine exits, and remove stream from stream cache
  • Add unit test to cover this scenario

Check List

Tests

  • Unit test
  • Integration test

Release note

  • Fix a bug that kv client may skip to recreate event feed receiving routine by accident.

@amyangfei amyangfei added type/bugfix This PR fixes a bug. needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. labels Jan 25, 2021
@amyangfei amyangfei added this to the v4.0.11 milestone Jan 25, 2021
@amyangfei
Copy link
Contributor Author

/run-all-tests

@amyangfei amyangfei force-pushed the kv-client-ut-stream-recv-failure branch from 8e8ed1b to 571855e Compare January 25, 2021 08:42
@amyangfei
Copy link
Contributor Author

/run-all-tests

@amyangfei
Copy link
Contributor Author

/run-all-tests

@amyangfei amyangfei added status/ptal Could you please take a look? and removed status/WIP labels Jan 25, 2021
@amyangfei amyangfei mentioned this pull request Jan 26, 2021
23 tasks
@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 27, 2021
@amyangfei
Copy link
Contributor Author

/run-all-tests

@amyangfei
Copy link
Contributor Author

/run-integration-tests

@amyangfei
Copy link
Contributor Author

/run-all-tests

@amyangfei
Copy link
Contributor Author

PTAL @liuzix

@liuzix
Copy link
Contributor

liuzix commented Jan 28, 2021

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jan 28, 2021
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Jan 28, 2021
@liuzix
Copy link
Contributor

liuzix commented Jan 28, 2021

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 28, 2021
@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 1345
  • 1362

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@amyangfei merge failed.

@amyangfei
Copy link
Contributor Author

/run-all-tests

@amyangfei
Copy link
Contributor Author

/run-kafka-tests

@amyangfei
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 1358

@ti-srebot
Copy link
Contributor

/run-all-tests

@codecov-io
Copy link

Codecov Report

Merging #1336 (fdcee9c) into master (e19ddc5) will increase coverage by 0.0018%.
The diff coverage is 100.0000%.

@@               Coverage Diff                @@
##             master      #1336        +/-   ##
================================================
+ Coverage   48.2311%   48.2330%   +0.0018%     
================================================
  Files           130        130                
  Lines         13201      13215        +14     
================================================
+ Hits           6367       6374         +7     
- Misses         6161       6165         +4     
- Partials        673        676         +3     

@ti-srebot ti-srebot merged commit 96fb454 into pingcap:master Jan 28, 2021
ti-srebot pushed a commit to ti-srebot/ticdc that referenced this pull request Jan 28, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #1373

@amyangfei amyangfei added the priority/p0 Issue with the highest priority, should be resolved as soon as possible. label Jan 28, 2021
@amyangfei amyangfei deleted the kv-client-ut-stream-recv-failure branch January 28, 2021 07:46
ti-srebot added a commit that referenced this pull request Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. priority/p0 Issue with the highest priority, should be resolved as soon as possible. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. status/ptal Could you please take a look? type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants