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

[Issue 491][rpc_client]fix: timeout guarantee for RequestOnCnx #492

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

jonyhy96
Copy link
Contributor

@jonyhy96 jonyhy96 commented Mar 24, 2021

Fixes #491

Motivation

see #491

Modifications

add timeout guarantee to RequestOnCnx

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (yes)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

Signed-off-by: jonyhy96 <hy352144278@gmail.com>
Copy link
Member

@wolfstudy wolfstudy left a comment

Choose a reason for hiding this comment

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

The change LGTM +1, just a little comments, please check

rpcResult := &RPCResult{
Cnx: cnx,
}
ch := make(chan result, 1)
Copy link
Member

Choose a reason for hiding this comment

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

Can we consider adjusting the size of the channel buffer appropriately? It looks like 10 is a good choice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

0 maybe enough for this because there will be only one result sends to ch . Set it to 1 to prevent block happens on the sender side.

@omnilight
Copy link
Contributor

@wolfstudy @jonyhy96 Hi. Could we proceed with this PR? Lack of the timeout on connection is a problem causing locking producer, would be great if we can release this fix

Copy link
Contributor

@freeznet freeznet left a comment

Choose a reason for hiding this comment

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

LGTM

@jonyhy96
Copy link
Contributor Author

ping @wolfstudy

@wolfstudy wolfstudy added this to the 0.6.0 milestone Jun 2, 2021
Copy link
Member

@wolfstudy wolfstudy left a comment

Choose a reason for hiding this comment

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

Great job! LGTM +1

@wolfstudy wolfstudy merged commit 8a78d2c into apache:master Jun 2, 2021
@jonyhy96 jonyhy96 deleted the fix-timeout-guarantee branch June 2, 2021 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Producer block may block forever
4 participants