Skip to content

Reject enabling debug on topologies without event loggers - #9285

Open
dragonknightk wants to merge 2 commits into
apache:masterfrom
dragonknightk:fix-debug-requires-eventlogger
Open

dragonknightk wants to merge 2 commits into
apache:masterfrom
dragonknightk:fix-debug-requires-eventlogger

Conversation

@dragonknightk

@dragonknightk dragonknightk commented Nov 18, 2026 •

Copy link
Copy Markdown

Fixes #7588

What is the purpose of the change

Nimbus now rejects a request to enable debug when the topology has no event loggers, and stores no debug options for it. The UI already disables the Debug button when topology.eventlogger.executors is 0, but the UI REST endpoint and Thrift clients could still enable debug. The check is in Nimbus.debug() because the UI REST endpoint and Thrift clients all go through it, so one check covers every entry point. It uses the existing StormCommon.hasEventLoggers() on the merged topology config, the same rule the executors use, so a null value (one event logger per worker) is still allowed. debug() does not declare InvalidTopologyException in storm.thrift, so the UI REST endpoint and Thrift clients only see a generic error; the full message is in the Nimbus log.

How was the change tested

NimbusClojurePortTest.testDebugRejectedWithoutEventLoggers submits a topology with topology.eventlogger.executors set to 0 on a simulated time LocalCluster. It checks that enabling debug at topology and at component level throws InvalidTopologyException, that component_debug contains neither the topology id nor the "spout" key, and that disabling debug still succeeds. The test fails without the Nimbus change. NimbusClojurePortTest.testDebugAllowedWithNullEventLoggers submits with topology.eventlogger.executors set to null, checks that the merged config still holds null although defaults.yaml sets 0, and checks that enabling debug succeeds and is stored. testDebugOnComponent and testDebugOnGlobal now submit with one event logger, since they enable debug. NimbusClojurePortTest and NimbusTest pass, and checkstyle reports no violations for storm-server.

Upgrade notes

Enabling debug on a topology whose topology.eventlogger.executors is 0 now fails instead of succeeding with no events logged. The UI REST endpoint returns HTTP 500 and Thrift clients get a TApplicationException. Set topology.eventlogger.executors to a value greater than 0, or unset it (null) for one event logger per worker.

AI Disclosure

Human-led contribution. Grok Bot, working for dragonknightk, assisted with this change, including the code, tests, and description. All submitted content was reviewed by a human before submission.

(。•̀ᴗ-)✧

Closes issue 7588

## What is the purpose of the change

Nimbus now rejects a request to enable debug when the topology has no event loggers, and stores no debug options for it. The UI already disables the Debug button when topology.eventlogger.executors is 0, but the UI REST endpoint and Thrift clients could still enable debug. The check is in Nimbus.debug() because the UI REST endpoint and Thrift clients all go through it, so one check covers every entry point. It uses the existing StormCommon.hasEventLoggers() on the merged topology config, the same rule the executors use, so a null value (one event logger per worker) is still allowed. debug() does not declare InvalidTopologyException in storm.thrift, so the UI REST endpoint and Thrift clients only see a generic error; the full message is in the Nimbus log.

## How was the change tested

NimbusClojurePortTest.testDebugRejectedWithoutEventLoggers submits a topology with topology.eventlogger.executors set to 0 on a simulated time LocalCluster. It checks that enabling debug at topology and at component level throws InvalidTopologyException, that no debug options are stored, and that disabling debug still succeeds. The test fails without the Nimbus change. NimbusClojurePortTest.testDebugAllowedWithNullEventLoggers submits with topology.eventlogger.executors set to null, checks that the merged config still holds null although defaults.yaml sets 0, and checks that enabling debug succeeds and is stored. testDebugOnComponent and testDebugOnGlobal now submit with one event logger, since they enable debug. NimbusClojurePortTest and NimbusTest pass, and checkstyle reports no violations for storm-server.

## Upgrade notes

Enabling debug on a topology whose topology.eventlogger.executors is 0 now fails instead of succeeding with no events logged. The UI REST endpoint returns HTTP 500 and Thrift clients get a TApplicationException. Set topology.eventlogger.executors to a value greater than 0 to use debug.

## AI Disclosure

Human-led contribution. Grok Bot, working for dragonknightk, assisted with this change, including the code, tests, and description. All submitted content was reviewed by a human before submission.

Signed-off-by: dragonknightk <[email protected]>
@rzo1 rzo1 added this to the 3.3.0 milestone Nov 18, 2026
@rzo1 rzo1 added the bug label Nov 18, 2026

@rzo1 rzo1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the contrib. The check belongs in Nimbus.debug() so every entry point is covered, and reusing StormCommon.hasEventLoggers() keeps the null = one-logger-per-worker case working. Two small nits inline, neither blocking. Agree with not declaring InvalidTopologyException on debug() in the IDL: older clients would silently drop the unknown exception field and treat the call as a success.

throw new WrappedNotAliveException(topoName);
}
if (enable && !StormCommon.hasEventLoggers(topoConf)) {
throw new WrappedInvalidTopologyException("Cannot enable debug for topology '"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "greater than 0" leaves out the other valid option. Maybe: "... Set topology.eventlogger.executors to a value greater than 0, or unset it (null) for one event logger per worker."

assertThrows(InvalidTopologyException.class,
() -> nimbus.debug("t1", "spout", true, 100));
StormBase base = cluster.getClusterState().stormBase(topoId, null);
assertFalse(base.is_set_component_debug() && !base.get_component_debug().isEmpty(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is_set && !isEmpty would also pass if some other entry were present. Asserting on the keys you tried is more direct, e.g. assertFalse(base.is_set_component_debug() && (base.get_component_debug().containsKey(topoId) || base.get_component_debug().containsKey("spout"))).

@rzo1
rzo1 requested review from GGraziadei and reiabreu November 18, 2026 08:23
Closes issue 7588

## What is the purpose of the change

Nimbus now rejects a request to enable debug when the topology has no event loggers, and stores no debug options for it. The UI already disables the Debug button when topology.eventlogger.executors is 0, but the UI REST endpoint and Thrift clients could still enable debug. The check is in Nimbus.debug() because the UI REST endpoint and Thrift clients all go through it, so one check covers every entry point. It uses the existing StormCommon.hasEventLoggers() on the merged topology config, the same rule the executors use, so a null value (one event logger per worker) is still allowed. debug() does not declare InvalidTopologyException in storm.thrift, so the UI REST endpoint and Thrift clients only see a generic error; the full message is in the Nimbus log.

## How was the change tested

NimbusClojurePortTest.testDebugRejectedWithoutEventLoggers submits a topology with topology.eventlogger.executors set to 0 on a simulated time LocalCluster. It checks that enabling debug at topology and at component level throws InvalidTopologyException, that component_debug contains neither the topology id nor the "spout" key, and that disabling debug still succeeds. The test fails without the Nimbus change. NimbusClojurePortTest.testDebugAllowedWithNullEventLoggers submits with topology.eventlogger.executors set to null, checks that the merged config still holds null although defaults.yaml sets 0, and checks that enabling debug succeeds and is stored. testDebugOnComponent and testDebugOnGlobal now submit with one event logger, since they enable debug. NimbusClojurePortTest and NimbusTest pass, and checkstyle reports no violations for storm-server.

## Upgrade notes

Enabling debug on a topology whose topology.eventlogger.executors is 0 now fails instead of succeeding with no events logged. The UI REST endpoint returns HTTP 500 and Thrift clients get a TApplicationException. Set topology.eventlogger.executors to a value greater than 0, or unset it (null) for one event logger per worker.

## AI Disclosure

Human-led contribution. Grok Bot, working for dragonknightk, assisted with this change, including the code, tests, and description. All submitted content was reviewed by a human before submission.

Signed-off-by: dragonknightk <[email protected]>
@dragonknightk

Copy link
Copy Markdown
Author

@rzo1 Thanks for the review! Both nits are addressed: the error message now also mentions unsetting topology.eventlogger.executors (null) for one event logger per worker, and the test now asserts that neither the topology id nor the "spout" key was written to component_debug. (。•̀ᴗ-)✧

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[STORM-3806] Enable the Debug action of the topology by bypassing the configur file through the webapp interface

2 participants