Program status has a race condition

Details

Fixed a bug that could cause the status of a running program to be falsely returned as stopped if the run happened to change state in the middle of calculating the program state. Also fixed a bug where the state for a suspended workflow was stopped instead of running.

Fixed a bug that could cause the status of a running program to be falsely returned as stopped if the run happened to change state in the middle of calculating the program state. Also fixed a bug where the state for a suspended workflow was stopped instead of running.

Rank:

1|i00bxr:

Description

When we lookup program status, we lookup program run records that are in the RUNNING state in one tx, then run records that are in the STARTING state in another tx. These should really be read in the same transaction.

In general, system APIs like Store, that wrap every method in a transaction, are vulnerable to these types of race conditions.