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

Configurable Async Action Timeout #4966

Closed
user-0a opened this issue Jun 2, 2020 · 16 comments · Fixed by #5762
Closed

Configurable Async Action Timeout #4966

user-0a opened this issue Jun 2, 2020 · 16 comments · Fixed by #5762
Labels
c/actions Related to actions c/server Related to server
Milestone

Comments

@user-0a
Copy link

user-0a commented Jun 2, 2020

Are async action timeouts configurable? From what I can tell, async actions have a default timeout of 30s. This limits their use case IMO, since their purpose is to perform some time-consuming action. As this 30 second timeout does not fit my application's needs, I would love to be able to configure this, if possible.

@rikinsk rikinsk added c/actions Related to actions c/server Related to server labels Jun 9, 2020
@tirumaraiselvan tirumaraiselvan added this to the v1.4 milestone Aug 20, 2020
@kodiakhq kodiakhq bot closed this as completed in #5762 Sep 16, 2020
@tirumaraiselvan tirumaraiselvan modified the milestones: v1.4, v1.3.3 Nov 9, 2020
@arys
Copy link

arys commented Nov 14, 2020

How to exactly configure timeout for action?
I've created new migration and added timeout argument like this:

- name: exportTemplate
  definition:
    handler: http://express:3000/actions/exportTemplate
    timeout: 3600

but timeout is still 30 seconds.

@RodolfoSilva
Copy link
Contributor

@arys have you tried with the latest version?

@arys
Copy link

arys commented Nov 18, 2020

@RodolfoSilva, sorry I didn't notice milestone v1.3.3 😅, I updated to latest version and it works now!

@RodolfoSilva
Copy link
Contributor

With me, the command:

hasura metadata export

This isn't working as expected, the command doesn't export the timeout.

@codingkarthik
Copy link
Contributor

@RodolfoSilva While adding the action, did you add a timeout with it? If you did, was the timeout 30 seconds? I ask this because currently we don't export the timeout when the timeout value is the default value (30 seconds).

@RodolfoSilva
Copy link
Contributor

@codingkarthik I've changed the action file putting timeout: 60, like @arys example, and executing the command: hasura metadata apply and later running hasura metadata export

@RodolfoSilva
Copy link
Contributor

actions.yaml

- name: my_awesome_action
  definition:
    kind: synchronous
    handler: '{{ACTIONS_BASE_URL}}/my_awesome_action'
    forward_client_headers: true
    timeout: 120

I've tried modify directly in the database but this does't work.

$ hasura version
INFO hasura cli                                    version=v1.3.3
INFO hasura graphql engine                         endpoint="http://localhost:8080" version=v1.3.3

@codingkarthik
Copy link
Contributor

codingkarthik commented Nov 18, 2020

@RodolfoSilva You mean you're not able to configure the timeout of the action, through the CLI?

@RodolfoSilva
Copy link
Contributor

@codingkarthik
Yes, with the CLI.

I've tried change directly in database, and use the CLI to export but this does not work too...

@codingkarthik
Copy link
Contributor

@RodolfoSilva if you have access to the hasura console, can you check by exporting metadata there?
Because, this seems to be an CLI issue.

cc: @scriptonist

@RodolfoSilva
Copy link
Contributor

@codingkarthik Yes, you are right. This is an issue with the CLI, after change directly in the database and export in the console, the timeout property is present in the JSON file.

    {
      "name": "my_awesome_action",
      "definition": {
        "handler": "{{ACTIONS_BASE_URL}}/my_awesome_action",
        "output_type": "AwesomeOutput",
        "forward_client_headers": true,
        "arguments": [
          {
            "name": "id",
            "type": "uuid!"
          }
        ],
        "type": "mutation",
        "kind": "synchronous",
        "timeout": 120
      },

@RodolfoSilva
Copy link
Contributor

In the actions.go file has no mention of timeout

@scriptonist
Copy link
Contributor

@RodolfoSilva created a new issue to track this #6220

@andoks
Copy link
Contributor

andoks commented Dec 16, 2020

Testing v1.3.3 today, I could not find the timeout option on the modify action console page, nor could I find it when creating a new action, nor could I find it in the documentation. If it does not work through the CLI either (#6220), how is it supposed to be set?

EDIT: found #6207, so that explains why I could not find it in the UI.

@sanderkooger
Copy link

I have tried and tested with 1.3.4.beta-2 But adding a timeout in actions.yaml and metadata apply do not get picked up. on the next export the timeout lines are nowhere to be found.

@DhvanilPatel
Copy link

@tirumaraiselvan facing the same issue. I'm on v1.3.3. Here's how I'm trying to set it – 

  1. Setting up the action from UI
  2. Editting actions.yaml to add timeout: 120
  3. hasura metadata export

^ this doesn't work. Is there anything I'm missing out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/actions Related to actions c/server Related to server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants