Skip to content

Commit

Permalink
fixed a race condition in the table update
Browse files Browse the repository at this point in the history
  • Loading branch information
evalott100 committed Jun 28, 2024
1 parent 6ffd344 commit 5813552
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/pandablocks_ioc/_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,16 @@ def update_table(self, new_values: List[str]) -> None:
field_data, field_name, field_record.field
)

# Must skip processing as the validate method would reject the update
field_record.record_info.record.set(waveform_val, process=False)
# This check prevents an infrequent race condition that occurs when the
# table is updated with a value after the record is in the process of
# being updated already, resulting in the rejection of the second
# update's value.
if not np.array_equal(
field_record.record_info.record.get(), waveform_val
):
# Must skip processing as the validate method would
# reject the update
field_record.record_info.record.set(waveform_val, process=False)

else:
# No other mode allows PandA updates to EPICS records
Expand Down

0 comments on commit 5813552

Please sign in to comment.