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

[BUG] If locally running function times out, CLI process hangs #64

Open
filmaj opened this issue Jun 3, 2024 · 1 comment
Open

[BUG] If locally running function times out, CLI process hangs #64

filmaj opened this issue Jun 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@filmaj
Copy link
Contributor

filmaj commented Jun 3, 2024

Problem

If you have a top-level function running locally, and it takes longer than 15 seconds to run, it will be timed out by the Slack backend. However, when running locally, the function process would still be executing. This can lead to odd behaviours.

As soon as the 15 second local timeout is hit, the Slack CLI process / activity logs will output:

2024-06-03 10:07:47 [info] [Fn05HKNRE370] (Trace=Tr0767DPGA69) Function 'Approval' (app function) started
2024-06-03 10:08:03 [error] [Fn05HKNRE370] (Trace=Tr0767DPGA69) Function 'Approval' (app function) failed
	event_dispatch_failed
2024-06-03 10:08:03 [error] [Wf05HURTRXTN] (Trace=Tr0767DPGA69) Workflow step 'Approval' failed
2024-06-03 10:08:03 [error] [Wf05HURTRXTN] (Trace=Tr0767DPGA69) Workflow 'Approval Workflow' failed
	Function failed to execute
2024-06-03 10:08:03 [error] [Fn05HPEXTU5B] (Trace=Tr0767DPGA69) Function 'Approval Workflow' (workflow function) failed
	Function failed to execute

At this point, however, the locally-running function is still executing. The SDK should, instead, kill the function. Otherwise, if the function continues to execute after this point and e.g. tries to return an error or complete the function, you will likely see the following in the CLI output:


functions.completeError response payload: { ok: false, error: "token_revoked" }
💌 We would love to know how things are going
   Survey your development experience with slak feedback --name platform-improvements

The CLI process will also hang at this point, forcing the dev to Ctrl+C to kill it. This is likely a CLI bug (you can see the feedback prompt at the end, but the process itself has not completed).

Additionally: the deployed function behaviour / logging / experience will log out the following right after the deployed function times out:

error: function execution exceeded 60.0s timeout

Desired Fixes

  • It would be good to provide a similar "function executed exceeded X timeout" error message in the local-run experience.
  • It would be good if we could kill the function after this timeout, then we could eliminate the class of bugs regarding using a revoked token and possibly short circuit the CLI hung process as well.
@filmaj filmaj added the bug Something isn't working label Jun 3, 2024
@tzuo9
Copy link

tzuo9 commented Sep 16, 2024

Any update on this? I think my local timeout is still something around 3s not 15s as well

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
None yet
Development

No branches or pull requests

2 participants