Fixed #1296 : Implement GET _changes feed timeout to prevent dead connection leaks#1384
Merged
Fixed #1296 : Implement GET _changes feed timeout to prevent dead connection leaks#1384
Conversation
Implemented GET _changes feed timeout to prevent dead connection leaks. The implementation is inline with couchdb and SG. The default timeout is 60000 miliseconds (same as couchdb but different from SG which has a default timeout as 5 mins) and the timeout will be disabled if heartbeat is specified. Note that couchbase-lite-ios doesn’t implement the timeout feature as the iOS listener doesn’t seem to have half-close socket issues as couchbase-lite-android is having. #1296
| } catch (Exception e) { | ||
| Log.w(TAG, "Error serializing JSON", e); | ||
| } | ||
| os.write(data); |
There was a problem hiding this comment.
In case writeValueAsBytes(body) throws exception, data is null. Is os.write(null) OK?
Contributor
Author
There was a problem hiding this comment.
I agree that the result from the code could be unexpected. This code is inherited from the current code. I don't want to change the behavior as we don't see any issues out of this.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implemented GET _changes feed timeout to prevent dead connection leaks. The implementation is inline with couchdb and SG. The default timeout is 60000 miliseconds (same as couchdb but different from SG which has a default timeout as 5 mins) and the timeout will be disabled if heartbeat is specified.
Note that couchbase-lite-ios doesn’t implement the timeout feature as the iOS listener doesn’t seem to have half-close socket issues as couchbase-lite-android is having.
#1296