Hi, it appears that since recently, code scheduled as a FastAPI background task is not being executed as expected anymore. I have a FastAPI handler that might execute a piece of business logic as background task (as specified in config file):
if context.config.async_order_processing:
logger.info(
f"Processing order {context.order_context.order.id} asynchronously"
)
background_tasks.add_task(execute_workflows, req, context)
else:
logger.info(
f"Processing order {context.order_context.order.id} synchronously"
)
execute_workflows(req, context)
The function execute_workflow handles a pipeline sequence of external API calls (OpenAI, Firebase, a bunch more) and logs status updates throughout the process.
But today, I deployed a new version with some minimal changes in totally unrelated files. However, the redeployment causes the pipeline handler to go completely wild. Amongst other things, I witnessed:
- Logs being extremely delayed by over 15 minutes
- Logs being shown in the Vercel dashboard completely out of order
- The error message
E0000 00:00:1759675677.049886 21 alts_credentials.cc:93] ALTS creds ignored. Not running on GCP and untrusted ALTS is not enabledbeing logged, which I’ve never seen before (apparently, this can be traced to a change in the python grpc package, but I haven’t changed my dependencies).
To be clear: when I run my project locally, the pipeline handler is completely fine and works as always. Also, when I change the configuration so async_order_processing is False, all issues go away.
Please let me know if you are away of any recent changes or bugs in relation to this setup. Happy to provide more details if needed!