[CAM-7971] Any non-Exception Throwable thrown during process execution can lead to inconsistent database state Created: 23/Jun/17  Updated: 28/Jul/17  Resolved: 03/Jul/17

Status: Closed
Project: camunda BPM
Component/s: engine
Affects Version/s: 7.8.0-alpha1
Fix Version/s: 7.8.0, 7.7.1, 7.6.7, 7.8.0-alpha2

Type: Bug Report Priority: L3 - Default
Reporter: Thorben Lindhauer Assignee: Svetlana Dorokhova
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes

Issue Links:
Depedendency
is depended on by CAM-8005 StackOverflowError when canceling pro... Closed

 Description   

If an instance of a Throwable that is not an Exception is thrown (e.g. StackOverflowError during deletion of a huge process instance - deleteCascade is recursive), then when the command context is closed

  • the engine will not properly catch this error, cf. [1]
  • the engine will close the command context, cf. [2]
  • the engine will flush all sessions, including the db entity manager, cf. [3]
  • the db entity manager will make SQL statements
  • the transaction will be committed, not rolled back

As a result, the database is in an inconsistent state.

[1] https://github.com/camunda/camunda-bpm-platform/blob/7.7.0/engine/src/main/java/org/camunda/bpm/engine/impl/interceptor/CommandContextInterceptor.java#L107
[2] https://github.com/camunda/camunda-bpm-platform/blob/7.7.0/engine/src/main/java/org/camunda/bpm/engine/impl/interceptor/CommandContextInterceptor.java#L113
[3] https://github.com/camunda/camunda-bpm-platform/blob/7.7.0/engine/src/main/java/org/camunda/bpm/engine/impl/interceptor/CommandContext.java#L132



 Comments   
Comment by Thorben Lindhauer [ 30/Jun/17 ]

relevant xkcd: https://xkcd.com/1188/

Generated at Wed Sep 20 03:55:45 CEST 2017 using JIRA 6.4.6#64021-sha1:33e5b454af4594f54560ac233c30a6e00459507e.