ucphhpc / migrid-sync

MiGrid workspace where master branch is kept strictly in sync with SF upstream svn repo. Any development or experiments should use a branch. You probably want to fork your own clone or work e.g. on the edge branch if you wish to contribute.
GNU General Public License v2.0
3 stars 4 forks source link

Add proper locking on the per-user transfers dictionary for synchronized access. #91

Closed jonasbardino closed 1 month ago

jonasbardino commented 1 month ago

Add proper locking on the per-user transfers dictionary to keep track of transfers for synchronized access when pickled to disk. This is mainly to rule out potential races in concurrent updates from same user - as indicated may have happened in reports from AU. Users have their own individual transfer pickle file so interference from other users should already be impossible. Extends existing inline unit tests to cover basic manipulation of the transfers file as well as some concurrency with locking. Additional work is pending to migrate or integrate existing unit tests with the new unit test framework from make test.

UPDATE: implemented proper unit tests in the new framework.

jonasbardino commented 1 month ago

As a side note transferfunctions and userdb modules are quite similar in the way they act on pickled dicts with file locking, so these unit tests for the former should be relatively easy to copy/translate into unit tests for the latter.

jonasbardino commented 1 month ago

Manually merged through svn for inclusion in upcoming release. Review is still most welcome, especially regarding the unit tests and the potential integration of the simple inline checks in the module itself. Therefore marked with follow-up pending label.