Skip to content

Conversation

@bbimber
Copy link
Collaborator

@bbimber bbimber commented Jan 22, 2026

Hello,

As you might know, JS trigger scripts default to a 60 second timeout. This is almost always more than enough, and if something takes more than 60 seconds might signal you should look at performance. I have some EHR-related ETLs that sync a lot of data between servers. They are largely stable and fine within that 60 second window, but we can get periods when one or more of these bumps against that window. I spent some time trying to improve that and gave up. Some of the caching that can be triggered in DemographicsService makes it difficult to avoid, and it's not user-facing. This is a longstanding issue I've been living with, but I am hoping to find a solution.

This PR proposes to allow code to customize that timeout. I propose we use the existing 'extraContext' mechanism. If 'scriptTimeout' is provided as an integer, RhinoService should use that value instead of 60. As a precaution, I set the MAX_ALLOWABLE_TIMEOUT as 300 (this is somewhat arbitrary), to prevent some code from going on forever. This means that the client or server-side code that makes the request can provide "scriptTimeout: XX", which should be respected.

I don't see a way for the JS trigger scripts themselves to modify extraContext to change the scriptTimeout themselves. This would be convenient, but is probably by design. While I cant write this myself anymore, it would be nice is the DataIntegration module ETL XML had a property for 'scriptTimeout', and then ETL would poke that into extraContext when it inserts/updates/deletes rows. ETL already pokes in "isETL" to extraContext, so I think the scope of that change ought to be rather small.

There's a related PR in TestAutomation to illustrate how this could work, at least from the client.

Does this concept seem acceptable? If so, I can expand some test cases. I'm happy to discuss other approaches to this.

@bbimber bbimber changed the base branch from develop to release25.11-SNAPSHOT January 22, 2026 01:30
@bbimber bbimber changed the title Allow trigger scripts to customize their own timeout Allow code to customize JS script timeout Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant