contest: retry when unable to load input files - #90
Conversation
The contest service was unable to load the 'branch_info' input file twice yesterday. Probably because it was being updated: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) Catch the error, and retry later. Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
Just to be able to see that there is something wrong going on. After this arbitrary limit, the service will crash, and this will be more visible than letting the service retrying over and over without actually updating Patchwork. The limit is set to 4, which should correspond to 5 minutes before reporting an error with these files if they stay corrupted for some reasons. Signed-off-by: Matthieu Baerts <matttbe@kernel.org>
|
I thought we had some "atomic update" method for updating the JSON files. Does it still race? Maybe some files are missing using that atomic update API? |
|
From what I understood, Lines 26 to 37 in 95a2926 It looks like there is a very small window where the file can be empty. |
|
That's the one, it should be doing an "atomic" write, write to a temp file and rename it overriding the existing file, instead of dumping directly to the output. |
The contest service was unable to load the 'branch_info' input file twice yesterday. Probably because it was being updated:
Catch the error, and retry max 4 more times with the same delay.