client: UserMappingGrid: Fixed two race conditions which resulted in
flaky unit tests (mostly when run through Valgrind). 1st race condition: When the gridmap file was rewritten, it was truncated first and then the new content was written. However, between both modifications the "mtime" of the file did not change and therefore no reload was triggered. To solve this problem, the file size is monitored now as well. 2nd race condition: It was possible that a new version of the gridmap file was written after the initial Start) and before the monitor thread was started and initialized the first known date and size of the file. Consequently, the monitor thread observed the new file as the latest known file and could not observe the change of state from old to new. Fixed by initializing monitored time and size of the gridmap file before the monitor thread gets started.
Loading
Please sign in to comment