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

Unable to run sync route execution longer than 60 seconds #339

Closed
denismakogon opened this issue Nov 24, 2016 · 6 comments
Closed

Unable to run sync route execution longer than 60 seconds #339

denismakogon opened this issue Nov 24, 2016 · 6 comments

Comments

@denismakogon
Copy link
Contributor

Container unexpectedly dies during sync execution but runs fine in docker using command after 1 minute execution:

docker run -d -i -P denismakogon/aioservice-examples:latest

Images:

Steps to reproduce:

curl -X POST -d '{"app":{"name":"testapp"}}' localhost:8080/v1/apps

curl -X POST -d '{"route":{"type": "sync", "path": "/sync", "image": "denismakogon/sleep120"}}' localhost:8080/v1/apps/testapp/routes

curl -X POST localhost:8080/r/testapp/sync

Function logs:
When POST to /r/{app}/route submitted

INFO[1442]                                               name=run.testapp.requests type=count value=1
INFO[1442]                                               name=run.testapp.waittime type=time value=0s

When container dies

INFO[1502] container status                              container_error= container_finished=2016-11-24 09:37:59.410257982 +0000 UTC container_running=false container_status=exited exit_code=137
INFO[1502]                                               name=run.testapp.error type=count value=1
INFO[1502]                                               name=run.testapp.time type=time value=1m0.06911744s
INFO[1502]                                               name="run.exec_time" type=time value=1m0.06911744s

But both containers are capable to run on Docker successfully.

It appears that sync func can run no longer than 60 seconds (Docker ReST client default HTTP timeout is 60 seconds).

Functions latest commit: af14904
Go version: 1.7
Docker version: 1.12.3, build 6b644ec

@denismakogon denismakogon changed the title Container unexpectedly dies during sync execution Unable to run sync route execution longer than 60 seconds Nov 24, 2016
@ucirello ucirello added this to the Alpha 2 milestone Nov 24, 2016
@ucirello
Copy link
Contributor

This is a bug. The problem is that there is a hard-coded 30s timeout in the source code.

Timeout: 30 * time.Second,

@treeder @pedronasser @seiflotfy - what would the appropriate fix? Is the timeout an attribute of the route or the task call?

@denismakogon
Copy link
Contributor Author

@ccirello would be the right fix to set execution timeout through API? There are three cases possible:

  1. No timeout specified - use default 60 seconds (or whatever it be)
  2. Timeout specified - run within timeout
  3. Run until not finished

cc @treeder @pedronasser @seiflotfy

@ucirello
Copy link
Contributor

would be the right fix to set execution timeout through API?

I don't see any other place to land the fix. :) It must be in the API - the only you way you can interface with IronFunctions daemon.

However, is this an attribute of the route (PUT /v1/apps/{app}/routes/{route}) or the task (POST /r/{app}/{route})?

@denismakogon
Copy link
Contributor Author

denismakogon commented Nov 24, 2016

@ccirello as i can see, it should be a part of routers API (POST /v1/apps/{app}/routes/{route}). Because in route payload we explicitly saying which functions we want to run along with route config instance, so it is a right place.

@pedronasser
Copy link
Contributor

I think the Timeout should be configured in the route/apps configuration and even maybe via a Header. If no timeout is specified use the default. (like @denismakogon suggested)

@denismakogon
Copy link
Contributor Author

@pedronasser to what kind of headers you're referring to?. We already have config object in payload, can't we just check on the API side if timeout was specified or not. In such case we have very small API impact (AFICS, only doc/swagger impact).

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