Skip to content

fix: Decode ComponentId to avoid UI throwing errors#3827

Merged
reiabreu merged 1 commit into
apache:masterfrom
paxadax:Storm-4148-fix-UI-throwing-error-on-Component-Page
Jan 10, 2025
Merged

fix: Decode ComponentId to avoid UI throwing errors#3827
reiabreu merged 1 commit into
apache:masterfrom
paxadax:Storm-4148-fix-UI-throwing-error-on-Component-Page

Conversation

@paxadax

@paxadax paxadax commented Jan 10, 2025

Copy link
Copy Markdown
Contributor

What is the purpose of the change

After bumping our Storm services from Storm 1 to Storm 2, we faced an issue where some components fail to load through the UI.

500 Server Error
org.apache.storm.thrift.TApplicationException: Internal error processing getComponentPageInfo

Findings:
We verified that the getComponentPageInfo method works correctly for Spouts and Bolts with names that do not contain spaces.
However, it fails for components with names that contain spaces.
Root Cause:
The issue lies on how the parameter componentId is being passed. For example, in the StatsUtils.componentType method:

public static String componentType(StormTopology topology, String compId) {
if (compId == null) {
return null;
}

Map<String, Bolt> bolts = topology.get_bolts();
if (Utils.isSystemId(compId) || bolts.containsKey(compId)) {
    return ClientStatsUtil.BOLT;
}
return ClientStatsUtil.SPOUT;

}

Error Scenario:

When accessing the component page of a Bolt named Test Error, the compId value is "Test+Error".
However, in the bolts map, the component key is stored as "Test Error".
This mismatch prevents the bolts map from finding the component, leading the method to incorrectly return the SPOUT value for a Bolt.

On this PR we're decoding the componentId string so it will match the correct value.

How was the change tested

Compiled the project, copied the jar into my machine and verified that the UI is now loading the components for names with spaces

@reiabreu reiabreu merged commit 457194d into apache:master Jan 10, 2025
@rzo1

rzo1 commented Jan 10, 2025

Copy link
Copy Markdown
Contributor

@reiabreu

reiabreu commented Jan 10, 2025 via email

Copy link
Copy Markdown
Contributor

@paxadax

paxadax commented Jan 10, 2025

Copy link
Copy Markdown
Contributor Author

Hey, sorry, I've forgot to link the issue, we had already created.

https://issues.apache.org/jira/browse/STORM-4148

@rzo1

rzo1 commented Jan 10, 2025

Copy link
Copy Markdown
Contributor

Thanks for the PR @paxadax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants