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

Odinson server cuts connection after 75 seconds #35

Closed
mcshlain opened this issue Sep 8, 2019 · 10 comments · Fixed by #43
Closed

Odinson server cuts connection after 75 seconds #35

mcshlain opened this issue Sep 8, 2019 · 10 comments · Fixed by #43

Comments

@mcshlain
Copy link
Contributor

mcshlain commented Sep 8, 2019

Describe the bug
When executing a long query (against the backend API) the connection is cut by the server.
The connection always terminates at the 1 minute, 15 seconds mark. This makes it hard to work with odinson against very large corpora.

To Reproduce
Any query that doesn't return in 75 seconds.

Expected behavior
I would expect the connection to stay alive until results are returned.

Screenshots/Errors
Two output of curl and the timing with date (IP parts replaced by X).

date && curl -v -X GET "http://X.X.X.X:9000/api/search?odinsonQuery=%5B%5D%20%3Edobj%20%5B%5D" -H "accept: application/json" || date
Sun Sep  8 15:23:56 IDT 2019
Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying X.X.X.X...
* TCP_NODELAY set
* Connected to X.X.X.X (X.X.X.X) port 9000 (#0)
> GET /api/search?odinsonQuery=%5B%5D%20%3Edobj%20%5B%5D HTTP/1.1
> Host: X.X.X.X:9000
> User-Agent: curl/7.58.0
> accept: application/json
> 
* Recv failure: Connection reset by peer
* stopped the pause stream!
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
Sun Sep  8 15:25:11 IDT 2019
date && curl -v -X GET "http://X.X.X.X:9000/api/search?odinsonQuery=%5B%5D%20%3Edobj%20%5B%5D" -H "accept: application/json" || date
Sun Sep  8 15:30:00 IDT 2019
Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying X.X.X.X...
* TCP_NODELAY set
* Connected to X.X.X.X (X.X.X.X) port 9000 (#0)
> GET /api/search?odinsonQuery=%5B%5D%20%3Edobj%20%5B%5D HTTP/1.1
> Host: X.X.X.X:9000
> User-Agent: curl/7.58.0
> accept: application/json
> 
* Recv failure: Connection reset by peer
* stopped the pause stream!
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
Sun Sep  8 15:31:16 IDT 2019
@myedibleenso
Copy link
Member

@mcshlain, can you please try running the issue35 branch branch to confirm that those changes take care of timeout you reported?

@mcshlain
Copy link
Contributor Author

Will do.

@mcshlain
Copy link
Contributor Author

The branch did not solve the issue, I'm still getting the connection cut after 75 seconds:

'''
$ date > time.it && curl -X GET "http://localhost:9000/api/search?odinsonQuery=%5B%5D%20%3Cnsubj%20%5B%5D" -H "accept: application/json" || date >> time.it
$ cat time.it
Mon Sep 23 09:12:49 IDT 2019
Mon Sep 23 09:14:04 IDT 2019
'''

@mcshlain
Copy link
Contributor Author

I've encountered this:
https://www.playframework.com/documentation/2.6.x/SettingsAkkaHttp
There is an option there called idleTimeout:

      # The idle timeout for an open connection after which it will be closed
      # Set to null or "infinite" to disable the timeout, but notice that this
      # is not encouraged since timeout are important mechanisms to protect your
      # servers from malicious attacks or programming mistakes.
      idleTimeout = 75 seconds

which is set to exactly 75 seconds, I tried playing with it at some point but couldn't make it work, but I have no experience with the play framework so I might have not been setting it correctly.

@myedibleenso
Copy link
Member

Thanks for testing it out.

Would you mind trying once more? I think I've figured out the problem. It seems that in development mode the HTTP server starts before the config is available, so this sort of setting has to be specified in the project's build.sbt.

@mcshlain
Copy link
Contributor Author

The new change worked, the query I used returned after 750 seconds (so it did not got cut after 75).

@myedibleenso
Copy link
Member

Curious to hear what sort of query and corpus you're using, but glad this last change took care of the timeout.

myedibleenso added a commit that referenced this issue Sep 23, 2019
These changes resolve #35.

* netty -> Akka server backend

* Change dev settings

[In development mode, the HTTP server is started before the config is available](https://www.playframework.com/documentation/2.7.x/ConfigFile#HTTP-server-settings-in-application.conf), so changes to the server (timeouts, host, ports, etc.) must be made in [`build.sbt`](https://github.com/lum-ai/odinson/blob/d3e94a06c36e7e9ff9fc937cda4685ef53b317d6/build.sbt#L84-L90)
@mcshlain
Copy link
Contributor Author

We're using the full wikipedia corpus (the index is 100GB) and I tested this with a [] <nsubj [] query. This is not the query that is actually interesting but it recreated the problem we encountered with other queries.

@myedibleenso
Copy link
Member

Now that's a real index! You're probably already aware of this, but if you're not using the UI (or at least not the detailed parse view), you can set this config property to false to substantially reduce the size of the index:

@mcshlain
Copy link
Contributor Author

thanks, I don't actually remember if we used this option or not when creating the index.

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 a pull request may close this issue.

2 participants