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

grpc: fix block send problem. #768

Merged
merged 3 commits into from Sep 26, 2017

Conversation

Projects
None yet
4 participants
@disksing
Member

disksing commented Sep 26, 2017

  1. make Send() supports timeout using the technique suggested by grpc/grpc-go#1229
  2. when the stream has error or been half closed, close both endpoints.

@disksing disksing requested review from overvenus and nolouch Sep 26, 2017

@nolouch

LGTM

}
return errors.Trace(err)
case <-time.After(regionHeartbeatSendTimeout):
atomic.StoreInt32(&s.closed, 1)

This comment has been minimized.

@siddontang

siddontang Sep 26, 2017

Member

if timeout here, the Recv may still be blocked?

@siddontang

siddontang Sep 26, 2017

Member

if timeout here, the Recv may still be blocked?

This comment has been minimized.

@disksing

disksing Sep 26, 2017

Member

It's ok to block at Recv because each RegionHeartbeat() is running in separated goroutine.

@disksing

disksing Sep 26, 2017

Member

It's ok to block at Recv because each RegionHeartbeat() is running in separated goroutine.

This comment has been minimized.

@siddontang

siddontang Sep 26, 2017

Member

Maybe a better way is to close the stream, but I find no public API sadly.

@siddontang

siddontang Sep 26, 2017

Member

Maybe a better way is to close the stream, but I find no public API sadly.

@disksing

This comment has been minimized.

Show comment
Hide comment
@disksing

disksing Sep 26, 2017

Member

/run-all-test

Member

disksing commented Sep 26, 2017

/run-all-test

@siddontang

LGTM

@siddontang

This comment has been minimized.

Show comment
Hide comment
@siddontang
Member

siddontang commented Sep 26, 2017

PTAL @nolouch

@nolouch

This comment has been minimized.

Show comment
Hide comment
@nolouch

nolouch Sep 26, 2017

Member

LGTM

Member

nolouch commented Sep 26, 2017

LGTM

@nolouch nolouch merged commit 4d27953 into master Sep 26, 2017

7 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-pd/build Jenkins job succeeded.
Details
jenkins-ci-pd/integration-common-test Jenkins job succeeded.
Details
jenkins-ci-pd/integration-ddl-test Jenkins job succeeded.
Details
jenkins-ci-pd/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@nolouch nolouch deleted the disksing/timeout branch Sep 26, 2017

disksing added a commit to disksing/pd that referenced this pull request Nov 28, 2017

grpc: fix block send problem. (#768)
* grpc: fix block send problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment