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

Incorrect Error Received: Invalid Async After Seconds during Cancellation of Async #1949

Open
moizarafat opened this issue Mar 22, 2021 · 0 comments

Comments

@moizarafat
Copy link
Collaborator

moizarafat commented Mar 22, 2021

Incorrect Error is being received when cancelling the Async Request

Expected Behavior

The CANCELLATION should happen without any error.

Current Behavior

CANCELLATION Throws an Error: Invalid Async After Seconds

Possible Solution

Currently in ASYNCAPI models we default the AsyncAfterSeconds to 10. So if a user overrides the default time in Application.yaml to anything lower than 10 seconds we get this error. AsyncAfterSeconds is a transient field so during the update the user will not be passing its value again so a default value is used again.

Instead of hardcoding the default value to 10 in the model. we should have a getMethod that checks if the user has set a value in application.yaml. If there is a value set there then use it else use 10.

User has supplied a value at Query Time 
--- Yes --> Use That
--- No --> Check for default value in Application.Yaml/Standalone Properties.
           ---> Value Found --> Yes ---> Use that as the default Value
                                         --> No ---> 10 seconds 

To make this to work for both spring and standalone, I recommend we add the user-supplied Configuration value to AsyncExecutorService or AsyncAPIHook and then retrieve from there in the model.

This will be a temporary solution till we make all the properties from Application.Yaml/Standalone Properties available in the ElideSettings object

Steps to Reproduce (for bugs)

  1. In application.yaml set maxAsyncAfterSeconds: 1
  2. Run a mutation to cancel an existing query:
    mutation ($id: ID) { asyncQuery(op: UPDATE, data: {id: $id, status: CANCELLED}) { edges { node { id status __typename } __typename } __typename } }

Context

A bug raised by Yavin User (Kevin Hinterlong @kevinhinterlong)

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.

1 participant