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

Middleware/resolver execution hangs after some time #1164

Open
mathieuprog opened this issue Mar 22, 2022 · 1 comment
Open

Middleware/resolver execution hangs after some time #1164

mathieuprog opened this issue Mar 22, 2022 · 1 comment

Comments

@mathieuprog
Copy link

We're experimenting with middlewares and we created a middleware that sleeps for 2 seconds before continuing, and added it as first middleware to run in the middleware chain:

defmodule MyApp.Schema.Middleware.TestMiddleware do
  @behaviour Absinthe.Middleware

  def call(resolution, _opts) do
    IO.inspect "--> hello"
    Process.sleep(2000)
    IO.inspect "--> world"
    resolution
  end
end
def middleware(middleware, _field, _object) do
  [Middleware.TestMiddleware, Middleware.Authenticate | middleware]
end

After approximately the 5th print of "--> hello" on my machine, "--> world" is no longer printed and the execution just seems frozen, without any error raised.

I expected to see at least some error, like a timeout error.

Any idea as to why it behaves like that?

Environment

  • Elixir version:

Erlang/OTP 24 [erts-12.0] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.12.3 (compiled with Erlang/OTP 22)

  • Absinthe version:

"1.7.0"

@benwilson512
Copy link
Contributor

Hi @mathieuprog, Absinthe itself does not introduce any timeouts. Can you show a complete example that I can run?

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

No branches or pull requests

2 participants