-
Notifications
You must be signed in to change notification settings - Fork 72
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
[#569] fix stored connections to match desired connection timeout #570
Draft
d-w-moore
wants to merge
8
commits into
irods:main
Choose a base branch
from
d-w-moore:569.fix_stored_connection_timeouts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2a55bc2
[_569] fix stored connections to match desired connection timeout
d-w-moore ee0e215
[_569] allow disabling connection timeouts
d-w-moore 8aae500
review correction
d-w-moore b4e9f2d
setting connection_timeout to zero is an error
d-w-moore f8ae904
README changes for connection_timeouts
d-w-moore e642053
testing
d-w-moore 9d48444
correction
d-w-moore 6577667
more corrections
d-w-moore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many systems also use 0 to indicate a non-value (or forever)… consider checking for 0 or None?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good point as evidently 0 means set nonblocking, and I believe we want to disallow that.
None
, however, in my opinion should be permissible as it is (for all intents) equivalent to a very large number.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other words
session.connection_timeout = None
is clear and correct in intent, if you take it to mean "eliminate timeouts totally for the given session."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that
None
conveys the intent.I was suggesting that if this is a user-facing setting, that setting it to either
0
orNone
would be equivalent and correct. If this is not user-facing, then... carry on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs now encourage the use of:
as a way to dictate how long the client socket should wait until declaring a server peer as down and giving up, as it were.
So, yes, it is user-facing....
But
0
andNone
are not equivalent here, actually.0
would invalidate the socket for further use by the PRC, by turning on non-blocking behavior (ie null-length values could now be read from the socket when it has not yet received any bytes of the expected server response) whereasNone
declares we never want to declare the server peer down. i.e. "turn off timeouts completely"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Windows is a different case, though, I should re-evaluate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries - if
None
is the only correct answer - please consider leaving a comment somewhere user-facing... that will let them know that0
behaves differently and why.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll update the docs to caution against setting 0 (which doesn't yet cause an immediate error , but should) or even too low a value, as the latter would have an effect down the line of raising a
NetworkError
the first time the server "responds too slowly"... which (as long as the server is alive and still working) would be technically incorrect practice on the application writer's part.