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

Fix context timeout in plugin hooks #346

Closed
mostafa opened this issue Oct 13, 2023 · 1 comment
Closed

Fix context timeout in plugin hooks #346

mostafa opened this issue Oct 13, 2023 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mostafa
Copy link
Member

mostafa commented Oct 13, 2023

Expected Behavior

The hook should be executed normally.

Current Behavior

The hook times out when called:

2023-10-13T17:50:42+02:00 ERR Hook returned an error error="rpc error: code = DeadlineExceeded desc = context deadline exceeded" hookName=HOOK_NAME_ON_SIGNAL priority=1001
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xb776a2]

goroutine 510 [running]:
github.com/gatewayd-io/gatewayd/plugin.(*Registry).Run(0xc0002d81c0, {0x17ce8d8, 0xc0000fd110}, 0x6?, 0x4fc3fe?, {0x0, 0x0, 0x0})
        /somewhere/gatewayd/gatewayd/plugin/plugin_registry.go:343 +0x8a2
github.com/gatewayd-io/gatewayd/cmd.StopGracefully({0x17ce830, 0xc00042b590}, {0x17ce8d8, 0xc0000fd110}, {0x17c9c40, 0x1da24b0}, 0xc0005ec9a0, 0xc0003582d0, 0xc0002d81c0, {{0x17cab90, ...}, ...}, ...)
        /somewhere/gatewayd/gatewayd/cmd/run.go:90 +0x1dd
github.com/gatewayd-io/gatewayd/cmd.glob..func9.6({0x17ce8d8, 0xc0000fd110}, 0xc00071e240?, {{0x17cab90, 0xc000394270}, 0xff, {0x0, 0x0}, {0xc000220400, 0x1, ...}, ...}, ...)
        /somewhere/gatewayd/gatewayd/cmd/run.go:764 +0x1f0
created by github.com/gatewayd-io/gatewayd/cmd.glob..func9 in goroutine 1
        /somewhere/gatewayd/gatewayd/cmd/run.go:753 +0x41d4
exit status 2
make: *** [Makefile:98: run] Error 1

Failure Information (for bugs)

The hook times out in 30s (default). If the server is killed after running for more than 30s, the OnShutdown hook doesn't get executed normally.

Resources

@mostafa mostafa added the bug Something isn't working label Oct 13, 2023
@mostafa mostafa added this to the v0.8.x milestone Oct 13, 2023
@mostafa mostafa self-assigned this Oct 13, 2023
@mostafa mostafa moved this from ✨ New to 📋 Backlog in GatewayD Core Public Roadmap Oct 13, 2023
@mostafa mostafa moved this from 📋 Backlog to 🚧 In progress in GatewayD Core Public Roadmap Oct 17, 2023
@mostafa
Copy link
Member Author

mostafa commented Oct 17, 2023

Fixed in #344.

@mostafa mostafa closed this as completed Oct 17, 2023
@mostafa mostafa moved this from 🚧 In progress to 👀 In review in GatewayD Core Public Roadmap Oct 17, 2023
@mostafa mostafa moved this from 👀 In review to 🔀 Merged in GatewayD Core Public Roadmap Oct 17, 2023
@mostafa mostafa moved this from 🔀 Merged to 🎉 Done in GatewayD Core Public Roadmap Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant