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

There isn't a way to set a timeout on query execution #112

Open
iku000888 opened this issue May 20, 2021 · 2 comments
Open

There isn't a way to set a timeout on query execution #112

iku000888 opened this issue May 20, 2021 · 2 comments
Assignees

Comments

@iku000888
Copy link

I see the vanilla lacinia supports a :timeout-ms with the execute API, but I seem to have trouble configuring from lacinia-pedestal in a top-down style. Thanks in advance and thank you for this great library 🙏

@hlship
Copy link
Member

hlship commented Aug 12, 2022

That doesn't look like it is supported using the provided interceptors and handlers.

@hlship hlship self-assigned this Aug 12, 2022
@hlship
Copy link
Member

hlship commented Aug 12, 2022

Although Lacinia provides a timeout option on executing queries (both in-thread and async), this is not exposed by lacinia-pedestal (which bypasses com.walmartlabs.lacinia/execute in any case).

This could be handled by the lacinia-pedestal handlers in some way, or by an async interceptor added to the interceptor chain.

Adding a timeout is not difficult (following the pattern in lacinia); for the in-thread case, it's about linking the ResolverResult to a promise, and adding a timeout to the deref; for async, it needs an alt! or some such.

However, I'm not quite sure what the right behavior is when an operation does in fact time out; perhaps we should just throw an exception and applications can add interceptors to catch that exception and deal with it in an application-appropriate way.

I'm going to direct Slack here for a discussion.

@hlship hlship changed the title Help on setting resolver timeout There isn't a way to set a timeout on query execution Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants