How is your experience with the OutSystems Community?
46
Views
8
Comments
Aggregate timeout setting doesn't seem to be working
Application Type
Reactive
Service Studio Version
11.55.24 (Build 64186)
Platform Version
11.18.1 (Build 37828)

Hi, all. I have a question about how timeout setting works on aggregates.

I have a aggregate in a server action to fetch some data to use them later.
I was trying to test error handling on the aggregate's time out, so I set "timeout" property of the aggregate to "1".

However, the aggregate did not timed out when I called the server action, even though the aggregate took much more than 1 second.

What could I be missing to make it work?

Thanks in advance.


2019-01-07 16-04-16
Siya
 
MVP

Simulating a timeout using an aggregate query is a bit challenging, as it's typically a SELECT statement, and the database may cache the results if the query parameters don't change. As a result, repeated executions may return too quickly to trigger a timeout.

However, you can easily simulate a timeout using an advanced query. For example, set the query to:

WAITFOR DELAY '00:00:05';

You can define the output as any structure . Then, set the query timeout to 1 second.

This will force the database to delay for 5 seconds, exceeding the 1 second timeout limit, and as a result, an exception will be thrown due to the timeout.

2025-07-22 10-30-27
Mandar Deshpande

Hi @Shinichiro Endo 

Setting the Aggregate timeout = 1 does not force the query to stop after 1 second.

In Reactive Web, when the aggregate is inside a Server Action, the timeout mostly controls how long the caller waits for the response, not necessarily whether the SQL execution itself gets aborted immediately. So even if your Aggregate takes more than 1 second, it may still complete successfully unless the request timeout / SQL timeout is hit.

Usually if you are trying to “test error handling”, use Server Request Timeout instead of Aggregate timeout. Because in real Reactive apps, users mostly experience:

  • spinner keeps loading
  • communication exception
  • request timeout

rather than a clean aggregate timeout.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

@Mandar Deshpande ,

i noticed you are active the last couple of weeks replying to old posts.  It is likely that the original poster is no longer interested / waiting for an answer.  Be mindful of that.

As to the content of your reply : your statement is incorrect : 

Setting the Aggregate timeout = 1 does not force the query to stop after 1 second.

And you are confounding server action timeout with aggregate timeout in this statement

In Reactive Web, when the aggregate is inside a Server Action, the timeout mostly controls how long the caller waits for the response, not necessarily whether the SQL execution itself gets aborted immediately. So even if your Aggregate takes more than 1 second, it may still complete successfully  

Setting a timeout on an aggregate gets passed along into the dbms, and the query stops executing when reached.  You will then get a database error saying "Error executing query. Execution Timeout Expired. "

On the other hand, if the timeout on the aggregate doesn't hit, but the timeout on the server action where the aggregate is used, then the error will be "The connection has timed out "

Dorine

2021-11-19 11-12-44
Rui Mendes

Hi @Shinichiro Endo,

As mentioned before, a 1 second timeout for an aggregate is way too short. 

Without knowing your specific scenario, I’d suggest bumping it up to 10 seconds, or even clearing it so it uses the default timeout 

2021-11-19 11-12-44
Rui Mendes

@Mandar Deshpande ,

Taking a closer look at your question, I see now that you're focusing on error handling for timeouts.

I put together a quick demo to show you how I handle it. Let me know if this hits the mark.

TestReact9.oml
2021-09-06 15-09-53
Dorine Boudry
 
MVP

@Rui Mendes ,

your second read of the question already moved you forward a little.  

Now read again, OP is asking specifically about aggregate timeouts, not server action timeouts.  There is no aggregate in sight on your demo oml.

2021-11-19 11-12-44
Rui Mendes


True, @Dorine Boudry , good catch. 
The demo shows how to trigger timeouts in actions, not specifically for aggregates. 

2025-07-22 10-30-27
Mandar Deshpande

Got it — thanks for the clarification. That makes sense.

I will re-test with a slower query to validate the Aggregate timeout behavior more accurately.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.