Skip to content

Commit

Permalink
[backend] do not overwrite suspendproject/resumeproject events
Browse files Browse the repository at this point in the history
Now that those events stack they are no longer idempotent. Thus we
need to randomize the event name.
  • Loading branch information
mlschroe committed Feb 26, 2020
1 parent 38059b8 commit af55e21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/backend/bs_repserver
Expand Up @@ -2679,6 +2679,10 @@ sub forwardevent {
$evname = "${type}:::".Digest::MD5::md5_hex($evname) if length($evname) > 200;
$arch = 'dispatch' if $type eq 'badhost';
$arch = 'publish' if $type eq 'publish';
if ($type eq 'suspendproject' || $type eq 'resumeproject') {
# those events stack - we must not overwrite them. randomize somewhat.
$evname = "type:::$$-".Digest::MD5::md5_hex("$$/$evname".time());
}
mkdir_p("$eventdir/$arch") if $arch;
if ($arch) {
dirty($projid, $repoid, $arch) unless !defined($repoid) || $arch eq 'dispatch' || $arch eq 'publish';
Expand Down

0 comments on commit af55e21

Please sign in to comment.