elsa-core icon indicating copy to clipboard operation
elsa-core copied to clipboard

Elsa 3 WorkflowExecutionLog persistence time out

Open Nokecy opened this issue 1 year ago • 2 comments

image

Nokecy avatar Jan 11 '24 00:01 Nokecy

PersistActivityExecutionLogMiddleware.cs--------EFCoreActivityExecutionStore.SaveManyAsync Execution timeout @sfmskywalker

Nokecy avatar Feb 01 '24 08:02 Nokecy

Hi, we're also facing this issue. To add some context, our users created workflows that have to iterate on many datas (around 3000) and then do some HttpRequest for each of them so we have around 400k WorkflowExecutionLogRecords for around 150 Workflow instances. Then, when new workflows trigger, the SavesMany shown in the stacktrace search in the whole table to find missing lines that lead to a timeout as EFCore cut commands that exceed 30 seconds by default.

As a workaround, we modified the timeout, but maybe we could make some optimisation on that by avoid using the BulkUpsert and just use the BulkInsert as LogExecutionRecords are all new records ?

jeanbaptistedalle avatar Aug 07 '24 13:08 jeanbaptistedalle

The latest version uses INSERT rather than UPSERT, so that should improve things. However, it could still be an issue if there are just too many records to insert within a reasonable timeout. Perhaps there should be a way to flush execution log records to the database during workflow execution, instead of flushing everything at the end of a burst of execution.

sfmskywalker avatar Jan 27 '25 14:01 sfmskywalker