Skip to content

Fixed #1296 : Implement GET _changes feed timeout to prevent dead connection leaks#1384

Merged
hideki merged 1 commit intomasterfrom
feature/issue_1296_conn_leaks
Aug 18, 2016
Merged

Fixed #1296 : Implement GET _changes feed timeout to prevent dead connection leaks#1384
hideki merged 1 commit intomasterfrom
feature/issue_1296_conn_leaks

Conversation

@pasin
Copy link
Copy Markdown
Contributor

@pasin pasin commented Aug 14, 2016

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

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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In case writeValueAsBytes(body) throws exception, data is null. Is os.write(null) OK?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@hideki hideki merged commit 9c35f35 into master Aug 18, 2016
@hideki hideki deleted the feature/issue_1296_conn_leaks branch August 18, 2016 22:10
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.

2 participants