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

No more assertion on 0 connection retries #145

Closed
wants to merge 1 commit into from

Conversation

bigbes
Copy link
Contributor

@bigbes bigbes commented Dec 2, 2018

This commit changes meanging of the retry_count option: now it means
amount of attempts to connect after the first one, not overall attempts
count.

Closes #83

@bigbes bigbes self-assigned this Dec 2, 2018
@bigbes bigbes requested a review from Totktonada December 2, 2018 22:33
long count = TARANTOOL_G(retry_count);
/* retry_count always 1 more than count of tries, since retry count
* is number of retries*/
long count = TARANTOOL_G(retry_count) + 1;
Copy link
Member

Choose a reason for hiding this comment

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

I have two points here:

  1. Backward compatibility. We change the sense of the option.
  2. What we want the option to mean? Tries count or tries count after the first one? I think the first (old behaviour). The real issue was the error message. I think we should get the old behaviour back and give a user an error message indicating the zero is not the valid value for that option.

Copy link
Collaborator

@rybakit rybakit Dec 13, 2018

Choose a reason for hiding this comment

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

@Totktonada I think that 0 is still a valid value for retry_count in case you want to disable the retrying functionality. But, in overall, I would completely drop this ini setting (and others as well) for the reasons I stated in #75.

Copy link
Member

Choose a reason for hiding this comment

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

@rybakit 0 is not valid 'tries count'. 0 is valid 'tries count after the first one`. The option (before this commit) means 'tries count'. So I don't get your point.

This can be alias for 1, but I think it'll just introduce more confusion.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My point is that I would like to have a way to disable retries. I don't really care if it starts from 1 or 0 as long as it can be disabled entirely.

Copy link
Collaborator

@rybakit rybakit Dec 13, 2018

Choose a reason for hiding this comment

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

0 is not valid 'tries count'.

Btw, I was talking about the tarantool.retry_count setting. And it's called *re*try_count, so I don't see your confusion, as I read it, it can be one insufficient call and 0 retry calls afterward.

Copy link
Member

Choose a reason for hiding this comment

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

I pushed the alternative in PR #166. No decision what to choose yet.

Copy link
Collaborator

Choose a reason for hiding this comment

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

However there are exceptions: --retries in parallel

From man parallel:

--retries n
    If a job fails, retry it on another computer on which it has not failed. Do this n times. ...

Copy link
Member

Choose a reason for hiding this comment

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

However there are exceptions: --retries in parallel

From man parallel:

--retries n
    If a job fails, retry it on another computer on which it has not failed. Do this n times. ...

The link above shows example that looks opposite.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The link above shows example that looks opposite.

I know, I just wanted to show that maybe parallel is not the best example to follow because its behavior does not reflect what is stated in its manual.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wow, Hi guys. IMHO @rybakit is damn right and the name of the option not match the content. But, backward compatibility is a very strong argument. I think updating the description is the optimal decision. I vote for #166 .

@MariaHajdic MariaHajdic force-pushed the gh-83-0-retries-assertion branch 2 times, most recently from c73d3b9 to 2c69e2e Compare June 16, 2020 19:08
@MariaHajdic MariaHajdic force-pushed the gh-83-0-retries-assertion branch from f4a8f12 to 1a627c3 Compare June 19, 2020 13:01
test/CreateTest.php Outdated Show resolved Hide resolved
@Totktonada Totktonada changed the base branch from php7-v2 to master June 29, 2020 22:15
@Totktonada Totktonada force-pushed the gh-83-0-retries-assertion branch from 1a627c3 to 73d3580 Compare July 14, 2020 10:55
@Totktonada
Copy link
Member

Rebased on top of current master and force-pushed.

test/CreateTest.php Outdated Show resolved Hide resolved
@Totktonada Totktonada force-pushed the gh-83-0-retries-assertion branch from 73d3580 to 8585fd3 Compare July 14, 2020 17:53
test/CreateTest.php Outdated Show resolved Hide resolved
This commit changes meanging of the `retry_count` option: now it means
amount of attempts to connect after the first one, not overall attempts
count.

Closes tarantool#83
@Totktonada Totktonada force-pushed the gh-83-0-retries-assertion branch from 8585fd3 to 425ad79 Compare July 14, 2020 22:00
Totktonada added a commit that referenced this pull request Jul 14, 2020
Clarified docs about this setting.

There may be a confusion whether the setting means overall amount of
connection attempts or amount after the initial unsuccessful attempt.
Usually a retries amount option means the latter, but here it means the
former.

Decided to don't change behaviour or the setting name to provide perfect
backward compatibility, but give meaningful error and clarify docs. See
the discussion in [1].

[1]: #145 (comment)

Fixes #83
@Totktonada Totktonada requested a review from LeonidVas July 14, 2020 23:48
Totktonada added a commit that referenced this pull request Jul 15, 2020
Clarified docs about this setting.

There may be a confusion whether the setting means overall amount of
connection attempts or amount after the initial unsuccessful attempt.
Usually a retries amount option means the latter, but here it means the
former.

Decided to don't change behaviour or the setting name to provide perfect
backward compatibility, but give meaningful error and clarify docs. See
the discussion in [1].

[1]: #145 (comment)

Fixes #83
@Totktonada
Copy link
Member

Thank you all for the participation!

I'll proceed with the less intrusive change (PR #166) for the backward compatibility sake.

We can return to the question after the future 0.3.4 release (deadlines are unclear, though), but take it as a proposal to improve the existing API, not as a fix of the bug (#83).

@Totktonada Totktonada closed this Jul 17, 2020
Totktonada added a commit that referenced this pull request Jul 17, 2020
Clarified docs about this setting.

There may be a confusion whether the setting means overall amount of
connection attempts or amount after the initial unsuccessful attempt.
Usually a retries amount option means the latter, but here it means the
former.

Decided to don't change behaviour or the setting name to provide perfect
backward compatibility, but give meaningful error and clarify docs. See
the discussion in [1].

[1]: #145 (comment)

Fixes #83
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.

An exception occurs while trying to disable connection retries
5 participants