When there is a connection failure while running _watch_build_tasks method then exit code '2' is returned and apropriate error message is logged.
Jira: RHELCMP-5143
Signed-off-by: Dominik Rumian drumian@redhat.com
rebased onto b0375837cec091c083e5b6b179480f692641201f
rebased onto 653844cb8ace1967d3b8dd045359dfcefee7e756
rebased onto 9473fcc964529a2ef71ee178b2d7f9565876d789
Testing results: It looks, that koji (or 'requests' lib) has its own mechanism of waiting/reconnecting. When I interrupted a network connection and reconnected it after, it survived and the process of watching continued after some time. But in the past, it wasn't enough every time. Our method adds extra attempts. Question is, whether these extra re-executed (watch)tasks will significantly help in these cases.
We are able to catch the specific exception and re-execute (watch)task few times. That's it.
better remove.
I prefer "attempts" instead of repetitions. It looks more natural to me.
requests.exceptions.ConnectionError
This is too general. Maybe something like "Couldn't finish the 'watch task' after N attempts. Reason: " ?
Link to the JIRA into the commit message, please.
Reconsider adding some delay (a few seconds) between attempts. Not to execute another attempt right after failing the previous one.
Koji ClientSession already performs retries on any API call. For details see https://pagure.io/koji/blob/master/f/koji/init.py#_2786 (_callMethod is relevant in case the line number changes in the future). I'm not sure adding another layer of retries here is a good idea.
_callMethod
It looks, that koji (or 'requests' lib) has its own mechanism of waiting/reconnecting.
that corresponds to my observations. Thanks for notifying us of the specific part in the koji's code.
OK, now I see, that returning a different code in case of koji fail is sufficient for the original request. My bad.
OK, sorry I have not noticed this piece of code in Koji. I will adjust this commit accordingly.
rebased onto 5749ccb38c4fe4f673b4c209662f850d1b0e4e5c
rebased onto e16dfc94bc40e3c678cfb7041031a4bb7a873a51
Looks, good.
Pull-Request has been merged by onosek
When there is a connection failure while running _watch_build_tasks
method then exit code '2' is returned and apropriate error message
is logged.
Jira: RHELCMP-5143
Signed-off-by: Dominik Rumian drumian@redhat.com