Aggregation timeout in Cosmos/MongoDb

Paul Conway 1 Reputation point
2022-02-02T16:07:29.177+00:00

I am running an aggregation in CosmosDB/MongoDB shell compatibily 4 in serverless mode with the C# mongodb driver version 2.14.1.

With small datasets the aggregates run to completion but with larger datasets I get a timeout after 60. I have tried setting a timeout in code but it has no effect. Is there anyway to increase this limit?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,901 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 20,911 Reputation points Microsoft Employee Moderator
    2022-02-03T16:25:29.49+00:00

    Hi @Paul Conway Thank you for posting your question on Microsoft Q&A and for using Azure services

    From my understanding you are trying to run an aggregation in CosmosDB/MongoDB shell compatibily 4 in serverless mode with the C# mongodb driver version 2.14.1 and getting a timeout after 60.
    The 60 sec timeout is a Cosmos-wide functionality that cannot be changed unfortunately. In a scalable system, long-running operations are an anti-pattern - splitting them up is the solution. Here's some documentation explaining that and some options to make things work: Troubleshoot common errors in Azure Cosmos DB's API for Mongo DB | Microsoft Learn

    Hope that helps

    If the answer helped solve your problem please mark as "accept" as it will be helpful for other community members with the same issue.

    Regards,
    Oury

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.