I hope you all are doing well. I’ve encountered an issue with Atlassian Forge that I hope someone here may have encountered before and can provide some advice.
As we all know, Forge functions have a hard limit of 25 seconds for their execution time. While this might not be an issue for smaller tasks, for more compute-intensive ones, like calling AI systems that require a bit of time to respond, this limit can be a hindrance.
Often, the function times out and users are presented with the less-than-user-friendly error message, “Function timed out past limit of 25.03 seconds”.
Needless to say, this doesn’t provide the best user experience and leaves our users in the dark about what exactly went wrong and what they can do about it.
I’ve been looking for ways to catch this timeout error within the Forge function, so I can handle it more gracefully. However, so far I have been unable to do so and my search in the Forge documentation has not yielded any positive results. It seems that these timeouts can’t be caught and handled programmatically.
So, I’m reaching out to the community to verify this.
- Is it true that function timeouts in Forge can’t be caught or handled?
- If yes, how are you all dealing with this? Are there any best practices or workarounds that you’d recommend for handling these timeouts more gracefully?
- If timeouts can be caught, could you share some code snippets or point me towards the right resources where I can learn to implement this?
This is a critical issue for us, and I’m sure many other developers using AI systems or other time-consuming tasks in their Forge apps face similar challenges.
Any advice or insights would be greatly appreciated!
Thanks in advance for your help.