ovis icon indicating copy to clipboard operation
ovis copied to clipboard

fixes #957 race on __ldms_format_set_meta_as_json

Open baallan opened this issue 2 years ago • 2 comments

__ldms_format_set_meta_as_json has an assumption of a lock on the set, but one of the call paths to __ldms_format_set_meta_as_json was missing that lock. ldmsd_set_register (descendants) and ldms_transaction_end are some of the other sites using it.

baallan avatar Jul 05 '22 21:07 baallan

@baallan, I believe the missing lock here is intentional. The set->lock is a hot-lock to the extent that it will hold off set updates and other important latency sensitive activities and the function in question is a bit of a pig. But it is possible to receive a dir request and get the last transaction time, etc... and/or a duration that is not for the posted transaction time. Given that these values are informational for the purpose of ldms_ls; absent an actual problem or bug, I'm not inclined to add this lock. If anyone can provide a use-case that is a bigger problem than introducing update jitter, I'm happy to reconsider.

tom95858 avatar Jul 12 '22 00:07 tom95858

@tom95858 should we not then document this behavior carefully and also remove the other use of locking the set for directory purposes? And I'm a little confused how it is a hot lock given that it only happens to single set instances in the seemingly unlikely event of competing directory call and not on a global structure. I also didn't see a great deal of evidence that the parts protected are 'piggish' in that they only reference memory and not io devices.

baallan avatar Jul 12 '22 12:07 baallan