Frontend checks the request, cancels the database event with the corresponding builds and generates a message. The message contains builds_id of builds affected by canceling. It also has reference to the canceled event: event_id.
Backend parses the message (using the FreshmakerManageRequestParser) and generates FreshmakerManageEvent. The event holds the body of the original message.
The event is further processed by CancelEventOnFreshmakerManageRequest handler, which finds build_id for each ArtifactBuild and tries to cancel them in external build system (Koji). For builds, which failed to cancel, it generates a list of builds_id, which is inject into a new event returned from the previous/already handled one. This way several retries are performed, until max_retries is reached.
The new approach of "Freshmaker manage" messages can be reused for other similar scenarios.
UPDATE: Core of the retry machinery has moved to FreshmakerManageEvent. There's a comment in the code explaining details.
builds_idof builds affected by canceling. It also has reference to the canceled event:event_id.FreshmakerManageRequestParser) and generatesFreshmakerManageEvent. The event holds the body of the original message.CancelEventOnFreshmakerManageRequesthandler, which findsbuild_idfor eachArtifactBuildand tries to cancel them in external build system (Koji). For builds, which failed to cancel, it generates a list ofbuilds_id, which is inject into a new event returned from the previous/already handled one. This way several retries are performed, untilmax_retriesis reached.The new approach of "Freshmaker manage" messages can be reused for other similar scenarios.
UPDATE: Core of the retry machinery has moved to
FreshmakerManageEvent. There's a comment in the code explaining details.