Skip to content

use mutex to lock protection around client conn during reconnect#2484

Closed
kadisi wants to merge 1 commit intocontainerd:masterfrom
kadisi:lock_protection
Closed

use mutex to lock protection around client conn during reconnect#2484
kadisi wants to merge 1 commit intocontainerd:masterfrom
kadisi:lock_protection

Conversation

@kadisi
Copy link
Copy Markdown
Contributor

@kadisi kadisi commented Jul 20, 2018

Signed-off-by: kadisi [email protected]
What this PR does / why we need it:
use mutex to lock client connection.

Special notes for your reviewer:
Fixes #2335
Release note:

use mutex to lock protection around client conn during reconnects

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 21, 2018

Codecov Report

Merging #2484 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2484   +/-   ##
=======================================
  Coverage   44.76%   44.76%           
=======================================
  Files          93       93           
  Lines        9555     9555           
=======================================
  Hits         4277     4277           
  Misses       4585     4585           
  Partials      693      693
Flag Coverage Δ
#linux 48.98% <ø> (ø) ⬆️
#windows 41.04% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a88b631...1fa9576. Read the comment docs.

Comment thread .gitignore Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@crosbymichael ok , thank you !

@dmcgowan
Copy link
Copy Markdown
Member

I am OK adding the lock for now (yes I know I advocated for it). I think we should completely ditch Reconnect in the next release and all the locking that goes with it though. The purpose of the Reconnect function was to solve a problem either related to a gRPC bug or misconfiguration. Either way that is no longer a problem.

@cpuguy83
Copy link
Copy Markdown
Member

Reconnect was to handle cases where containerd has restarted and cached client objects are pointing to a bad connection.

@dmcgowan
Copy link
Copy Markdown
Member

Reconnect was to handle cases where containerd has restarted and cached client objects are pointing to a bad connection.

gRPC already handles this but not when WithBlock is used. I updated it here https://github.com/moby/moby/pull/37149/files#diff-1a1f3e7ad9b1d7584e2d3e7d0c4c3db9R731 which will allow us to ditch this approach

@cpuguy83
Copy link
Copy Markdown
Member

Steak sauce!

@kadisi kadisi force-pushed the lock_protection branch from b8e4584 to 1fa9576 Compare July 24, 2018 01:34
@kadisi
Copy link
Copy Markdown
Contributor Author

kadisi commented Jul 24, 2018

@dmcgowan @crosbymichael so , is this pr is ok ? or i still need extra work?

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan
Copy link
Copy Markdown
Member

is this pr is ok ? or i still need extra work?

It's ok, I just didn't want everyone to be surprised if they see a PR removing all the locks later :)

@estesp
Copy link
Copy Markdown
Member

estesp commented Jul 24, 2018

Sorry to just notice this now, but this is the same exact PR as #2465 which hasn't been merged only because the submitter didn't initially have a DCO signoff, and now needs a rebase.

Usually, the first PR opened to fix an issue is the one that should get priority unless the original submitter (@fraenkel) isn't interested in doing the rebase.

@mlaventure
Copy link
Copy Markdown
Contributor

Just noticed the duplication with #2465 too.

@kadisi
Copy link
Copy Markdown
Contributor Author

kadisi commented Jul 25, 2018

i am very sorry about that , shoud i close this pr ?

@kadisi kadisi deleted the lock_protection branch March 14, 2019 09:05
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.

7 participants