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

Define and use notWaitForRetryTimeout #82

Merged
merged 1 commit into from Sep 25, 2018
Merged

Define and use notWaitForRetryTimeout #82

merged 1 commit into from Sep 25, 2018

Conversation

jumpeiMano
Copy link
Contributor

Reference: #81

@jumpeiMano
Copy link
Contributor Author

Is there a way to avoid these Travis CI build's errors?
=== test timeout ===
https://travis-ci.org/douban/libmc/builds/431835717?utm_source=github_status&utm_medium=notification

@ariesdevil
Copy link
Contributor

LGTM

@jumpeiMano
Copy link
Contributor Author

Thanks, @ariesdevil !
Could you merge this PR, please?

@ariesdevil ariesdevil merged commit 1b185ad into douban:master Sep 25, 2018
@@ -346,7 +353,7 @@ func (client *Client) newConn() (*conn, error) {
)

cn.configHashFunction(int(hashFunctionMapping[client.hashFunc]))
if client.retryTimeout > 0 {
if client.retryTimeout > 0 || client.notWaitForRetryTimeout {

This comment was marked as resolved.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh.. I see. Why not just change client.retryTimeout > 0 to client.retryTimeout >= 0 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If client.ConfigTimeout (golibmc.RetryTimeout, ~) is not called, client.RetryTimeout is 0, but in this case it was set to 5 which is default value until this PR was merged It was.
If I make a fix like > =, we have implemented another function, as it will cause a change to the user that used to do so.

Copy link
Contributor

Choose a reason for hiding this comment

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

If client.ConfigTimeout (golibmc.RetryTimeout, ~) is not called, client.RetryTimeout is 0, but in this case it was set to 5 which is default value until this PR was merged It was.

I don't understand why you said it is 0. If not called, it should be 5 (#define MC_DEFAULT_RETRY_TIMEOUT 5). After the PR is merged, it's still 5.

It looks like because of a bug introduced in 3b595db#diff-b21c9a32b7563e26c49d7f215bc5a656L584 . After that commit, the .ConfigTimeout function is not working anymore if called after the connection is established since timeout values won't be passed into the C++ layer. Actually the .ConfigTimeout has never been used in the golang code anymore, so how did you guys override the timeout values?

I think changing this to>= is acceptable and compatible with previous releases as the default behaviour is not changed at all.

cc @ariesdevil @MOON-CLJ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Calling c.client_config line is here.
And setting MC_DEFAULT_RETRY_TIMEOUT is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When implementing a connection pool, I fixed ConfigTimeout so that C. client_config will be called at the time when a new connection is created.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jumpeiMano how about init client.RetryTimeout to MC_DEFAULT_RETRY_TIMEOUT? and "just change client.retryTimeout > 0 to client.retryTimeout >= 0"。I also think notWaitForRetryTimeout is not necessary。

@jumpeiMano jumpeiMano deleted the feature/fix-golibmc-retry-timeout branch September 27, 2018 01:08
tclh123 added a commit that referenced this pull request Feb 18, 2019
ChangeLog:

- use pickle protocol version 2 (#52)
- fix rvalue reference (#53)
- Fix tests (#55)
- golibmc_test: Fix fragile test case (#56)
- Use connection pool in golibmc(again) (#57)
- golibmc Quit ret err (#59)
- cmake: Incorporate gtest in a standard way (#58)
- Rename refactor (#60)
- sync rapidjson/itoa.h upstream fix (#65)
- split cppcheck (#67)
- split FSM_GET_BYTES_CAS (#68)
- Avoid noisy recv_err when broadcast quit (#73)
- Try to support updating some servers without affecting others (#74)
- make normalize_key cpdef & add warnings for unpickle unmarshal fail (#66)
- fix fcntl usage when set socket nonblock (#69)
- minor fix (#61)
- add condition log macro (#77)
- Define and use notWaitForRetryTimeout (#82)
- upgrade travis to gcc 7 (#91)
- add func errCodeToString (#79)
- Introduce a reconnect mechanism in waitPoll (#88)
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.

None yet

4 participants