VMContext bots behavior on server restarts
# support
d
Hi folks, When running
vmcontext
bots and the server gets restarted, what happens to in-flight bot requests? Do they get retried when the server comes back up? Example: Someone updates a resource that has a subscription for a bot but the server gets restarted right as the bot is about to get fired. What happens? And follow-up - if the request to the bot is lost, would an aws lambda bot be a solution? As in, are aws lambda-based bots more resilient? TIA
p
Is it running locally or on AWS?
c
> When running vmcontext bots and the server gets restarted, what happens to in-flight bot requests? Hi @dselans - this is a good question. First, it depends on the nature of the server restart. On graceful shutdown, the server should wait for in-flight executions to complete. On forceful shutdown (i.e., kill -9), then those bot executions will hard fail. Second, it depends on the nature of the bot invocation. If invoking directly via
$execute
, then no, it will not retry. If invoking indirectly via Subscription or cron, then yes, it will automatically retry (via BullMQ).
> And follow-up - if the request to the bot is lost, would an aws lambda bot be a solution? As in, are aws lambda-based bots more resilient? Lambda based bots are ever-so-slightly more resilient, because there is no forceful termination, so once started they will always complete. But that's very much on the margin. Overall, both vmcontext bots and lambda bots are orchestrated by BullMQ jobs, and will therefore automatically retry, etc.
d
Great! Thank you very much for the detailed response!
181 Views