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

LiteServ logs disconnect warnings #973

Closed
ashvindersingh opened this issue Nov 11, 2015 · 7 comments
Closed

LiteServ logs disconnect warnings #973

ashvindersingh opened this issue Nov 11, 2015 · 7 comments

Comments

@ashvindersingh
Copy link

01:28:38.148‖ WARNING: CBLHTTPConnection: Client disconnected: Error Domain=GCDAsyncSocketErrorDomain Code=4 "Read operation timed out" UserInfo=0x7f8cc2b5b7b0 {NSLocalizedDescription=Read operation timed out}

Found in release:1.1.1

Steps:

  • Download and unpack the latest 1.1.1 build
  • Setup local sync gateway
  • Launch LiteServ pointing to local sync gateway and setup pull replication
  • Add document on SG using SG rest api
  • After certain amount of time. Liteserv throws above warning.
@snej
Copy link
Contributor

snej commented Nov 11, 2015

Can you reproduce this on the release/1.2 branch? At this point the 1.1.1 sourcebase is pretty old.

@snej
Copy link
Contributor

snej commented Nov 11, 2015

Wait, I don't think I understand the steps to reproduce. The warning is from CBLHTTPConnection, which is part of the listener — it handles an incoming REST call to LiteServ. But the directions above refer to LiteServ pulling from SG, which isn't going to involve the listener at all. So, what is connecting to LiteServ to trigger a CBLHTTPConnection?

@ashvindersingh
Copy link
Author

ah my bad, Please try the following steps. This should reproduce the issue:
Build: http://latestbuilds.hq.couchbase.com/couchbase-lite-ios/0.0.0/ios/0.0.0-550/

  1. Launch liteserv --port 49840
  2. Create a database using PUT http://localhost:49840/local_db_01
  3. Wait for about 2 min
  4. Warning appears on stdout:
    10:54:20.043‖ WARNING: CBLHTTPConnection: Client disconnected: Error Domain=GCDAsyncSocketErrorDomain Code=4 "Read operation timed out" UserInfo=0x7fc4c3d0e700 {NSLocalizedDescription=Read operation timed out}

@snej
Copy link
Contributor

snej commented Nov 12, 2015

Can't reproduce this — I've used both curl and httpie to send the PUT request, and waited 5 minutes afterwards, but got no warnings. Can you describe exactly what you did in step 2?

@snej snej changed the title LiteServ throws disconnect warnings LiteServ logs disconnect warnings Nov 12, 2015
@ashvindersingh
Copy link
Author

Reruning the above scenario with CURL did not generate the warning. However the warnings appear when using liteserv with nodejs or using POSTMAN http client.

@zgramana zgramana added this to the 1.2 milestone Nov 13, 2015
@zgramana zgramana added the ready label Nov 13, 2015
@snej
Copy link
Contributor

snej commented Nov 16, 2015

This happens if the client uses a keep-alive connection, so the socket stays open after the first request, but then doesn't send any subsequent request. After a few minutes CocoaHTTPServer times out the socket and closes it. This is a normal thing to do, so I should suppress the warning (in my code.)

@snej
Copy link
Contributor

snej commented Nov 16, 2015

Fixed on branch release/1.2.

@snej snej closed this as completed Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants