Repository navigation
Limit deploying and undeploying channels to the requested IDs (fixes #456) - #567
Merged
tonygermano merged 1 commit intoNov 26, 2026
Conversation
iacsha
requested review from
a team,
gibson9583,
jonbartels,
kayyagari,
kpalang,
mgaffigan,
pacmano1 and
ssrowe
November 7, 2026 01:17
gibson9583
approved these changes
Nov 16, 2026
tonygermano
approved these changes
Nov 24, 2026
tonygermano
left a comment
Member
There was a problem hiding this comment.
Focused, correct fix for #456, and the tests and repro numbers make it easy to verify. Thank you!
Claude checked (no action needed): the new tests pass on this branch, and 3 of the 5 fail with the filter reverted, as the description says.
🤖 Drafted with Claude Code
mgaffigan
approved these changes
Nov 24, 2026
…penIntegrationEngine#456) getDashboardChannels filtered deployed channels by the requested channel IDs but added every deploying and undeploying channel unfiltered. A request for channel A made while channel B was mid-deploy or mid-undeploy therefore included B, and GET /channels/{A}/statistics, which returns the first entry, could describe B. Apply the same filter to the transitional sets. The collection logic moves into a package-private static helper so it can be unit tested. Signed-off-by: iacsha <122627209+iacsha@users.noreply.github.com>
tonygermano
force-pushed
the
fix/456-channel-statistics-race
branch
from
November 26, 2026 12:10
28bf0f1 to
da38caf
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.
Fixes #456.
Cause.
DonkeyEngineController.getDashboardChannels(channelIds)filtersdonkey.getDeployedChannels()by the requested IDs, but then adds every channel indeployingChannelsandundeployingChannelswithout that filter. So while channel B is mid-deploy or mid-undeploy, a request scoped to{A}also gets B.ChannelStatisticsServlet.getStatistics(channelId)returnschannelStatisticsList.get(0), and when A is not deployed, B (a dashboard channel) is listed before undeployed A, so the response describes B. The same helper feedsgetChannelStatusList, so per-channel dashboard status was affected too.Fix. Apply the requested-ID filter to the deploying and undeploying sets as well. Unfiltered requests (no IDs) behave exactly as before, and a deployed channel still wins over a transitional entry with the same ID. The collection logic moved into a package-private static
getDashboardChannels(deployed, deploying, undeploying, channelIds)so it can be unit tested without starting the engine; the instance method delegates to it.Tests. New
DonkeyEngineControllerDashboardChannelsTest(5 cases). With the filter removed, 3 of them fail; with the fix, all pass. Full:server:testpasses (841 tests, 0 failures).End-to-end repro (the issue's steps, on images built from
mainand from this branch, fresh appdata each): two VM-reader channels A and B, A left undeployed; one loop deploys B, sends a message, and undeploys B; three loops pollGET /api/channels/{A}/statisticsfor 90 seconds.mainWith A deployed,
mainhappened not to show it in my runs because HashMap order put A first, which is luck rather than correctness; the fix doesn't depend on ordering.Release Note
Statistics and status requests for specific channels no longer include other channels
When a request asked for specific channels while another channel was being deployed or undeployed, the response could also include that other channel. This affected:
GET /channels/{channelId}/statistics, which returns the first channel in the list, so it could return the other channel's statistics instead of the requested one.GET /channels/statisticsandPOST /channels/statistics/_getStatisticswhen given channel IDs, which could include an extra entry for the other channel.GET /channels/statusesandPOST /channels/statuses/_getChannelStatusListwhen given channel IDs, which could include an extra entry for the other channel. With an authorization plugin installed, that entry was not checked against the user's channel permissions.Requests for all channels were not affected.