Commit 6b093f4
authored
Fix race condition at exit of monitoring filesystem radio (#4041)
This was uncovered by removal of an unrelated sleep in PR #4037, but I
think it will present itself (as missing monitoring data, rather than as
an error/exception) in user-facing code.
### Prior to this PR
A monitoring message could be written to the new_dir and then shortly
after the exit event could be set, sufficiently close in time that the
monitoring radio receiver loop exited without seeing those new message
files.
This PR modifies the exit behaviour of that loop to have one final
iteration with the following ordering of events:
1. monitoring messages are written
2. task completes
3. parsl begins to shut down
4. monitoring radio exit event is set by DFK
5. monitoring radio loop observes exit event
### As of this PR
6. monitoring radio loop performs one final processing of directory
The new behaviour here is step 6, that a final directory processing will
always happen strictly after the exit event is set, which is strictly
after the monitoring messages are written in step 1, assuming
directories are consistently observable from different places in the
filesystem.
The misbehaviour can be observed by increasing the delay time of the
loop before this PR (for example to 10 seconds) and running the test
suite.
With this race condition addressed, the loop poll period can be made
longer and this PR arbitrarily increases it from 1 second to 10 seconds
- although it could also be made configurable.
# Changed Behaviour
I expect some situations where end of task monitoring data may have been
missing to now not be missing that data.
## Type of change
- Bug fix1 parent 2571116 commit 6b093f4
1 file changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
42 | 54 | | |
43 | 55 | | |
44 | 56 | | |
| |||
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
56 | | - | |
57 | 68 | | |
58 | 69 | | |
59 | 70 | | |
| |||
0 commit comments