fix(activities): route activities to queues by lookup, and check the fallback - #452
Merged
KillerX merged 1 commit intoAug 14, 2026
Merged
Conversation
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 13, 2026 08:49
014dd26 to
17ced97
Compare
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 13, 2026 13:26
17ced97 to
5e07d0f
Compare
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 14, 2026 06:37
5e07d0f to
6fe109a
Compare
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 14, 2026 07:15
6fe109a to
cb685d1
Compare
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 14, 2026 08:16
cb685d1 to
70f0c1e
Compare
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 14, 2026 08:38
70f0c1e to
853461e
Compare
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 14, 2026 08:54
853461e to
742135c
Compare
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 14, 2026 09:18
742135c to
989de96
Compare
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 14, 2026 10:00
989de96 to
c7aca07
Compare
…fallback GetQueueForActivity walked three slices with lo.Contains on every Execute call to answer a question with a fixed answer. It is a map built once now, which also gives the routing one place to live. Building it once makes the collision case detectable: two structs defining the same method name would make the answer depend on the order of the three loops. It panics instead. That is not a new class of failure — activities are registered under the same short name, the worker runs with DisableRegistrationAliasing, and the debug queue registers every struct, so the worker would refuse to start anyway. Failing in the builder says why. The silent fallback cannot be removed. A name says nothing about what an activity needs, so an ffmpeg activity hung on the wrong struct lands on the worker queue and fails there as an opaque timeout — the audit's point. TestEveryFFmpegActivityIsOnAnFFmpegQueue reads the package source instead: it finds every exported activity method whose body reaches into the ffmpeg or transcode packages and asserts it hangs off Audio or Video. Thirty-eight methods qualify today, and the test requires a known one to be found so it cannot pass by looking at nothing. One is already in that trap, allowlisted and logged rather than moved here, because moving it changes which worker runs it: CropShortActivity calls ffmpeg.GetStreamInfo from UtilActivities to choose between 25 and 50 fps, on a queue whose image has no ffmpeg, and discards the error — so it does not fail, it quietly crops 50 fps material at 25. Also added the test the audit asked for, that no activity name is defined on two structs. There are 112 of them and they are unique today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
KillerX
force-pushed
the
fix/activity-queue-routing-map
branch
from
August 14, 2026 10:04
c7aca07 to
4bd6cc5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
13/n of a stack. Base:
refactor/execute-shared-body(#451). Closes Activity→queue routing is stringly-typed with a silent fallback.Directly related to #451:
GetQueueForActivityis the one callexecuteOnQueuemakes to decide a queue, so that extraction concentrated everything on this function.It walked three slices with
lo.Containson everyExecutecall to answer a question with a fixed answer. It is a map built once now.Building it once makes the collision case detectable. Two structs defining the same method name would make the answer depend on the order of the three loops; it panics instead. Not a new class of failure — activities are registered under the same short name, the worker runs with
DisableRegistrationAliasing, and the debug queue registers every struct, so the worker would refuse to start anyway. Failing in the builder says why.The silent fallback cannot be removed. A name says nothing about what an activity needs, so an ffmpeg activity hung on the wrong struct lands on the worker queue and fails there as an opaque timeout — the audit's point.
TestEveryFFmpegActivityIsOnAnFFmpegQueuereads the package source instead: it finds every exported activity method whose body reaches into theffmpegortranscodepackages and asserts it hangs offAudioorVideo. 38 methods qualify today, and the test requires a known one to be found so it cannot pass by looking at nothing.One activity is already in that trap.
CropShortActivitycallsffmpeg.GetStreamInfofromUtilActivitiesto choose between 25 and 50 fps, on a queue whose image has no ffmpeg — and it discards the error, so it does not fail, it quietly crops 50 fps material at 25. Allowlisted and written up inpotential_improvements.mdrather than moved here, because moving it changes which worker runs it. Two ways out, both wanting your call: move the probe into the video activity that runs the resulting arguments, or move the whole activity toVideoActivities.Also added the test the audit asked for: no activity name defined on two structs. There are 112 and they are unique today.
🤖 Generated with Claude Code