I've seen some errors from the sync_pull_ref task that uses update_pull_ref function. After looking into this, my best guess is that some workers failed/were restarted before being able to get the finally clause, thus not deleting the pull ref in the fork. This means that on subsequent runs for the same PR, the sync_pull_ref task would always fail. This patch fixes that by making sure the ref is deleted before it's created again, so this shouldn't happen again.
The possible downside of this (which IMO doesn't hurt) is that the pull ref can stay in the fork forever, but I don't see it as a huge issue. We could use both the try/finally approach and this new approach to prevent this from happening as much as possible.
I've seen some errors from the
sync_pull_reftask that usesupdate_pull_reffunction. After looking into this, my best guess is that some workers failed/were restarted before being able to get thefinallyclause, thus not deleting the pull ref in the fork. This means that on subsequent runs for the same PR, thesync_pull_reftask would always fail. This patch fixes that by making sure the ref is deleted before it's created again, so this shouldn't happen again.The possible downside of this (which IMO doesn't hurt) is that the pull ref can stay in the fork forever, but I don't see it as a huge issue. We could use both the try/finally approach and this new approach to prevent this from happening as much as possible.
Tests are coming :)