| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Prevents missing-tenant authorization requests from producing erroneous broker ERROR logs while preserving 404 responses and genuine metadata-failure logging.
Changes:
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file| File | Description |
|---|---|
| PulsarAuthorizationProvider.java | Separates missing-tenant rejection from metadata error logging. |
| MultiRolesTokenAuthorizationProvider.java | Applies the same correction for multi-role tokens. |
| PulsarAuthorizationProviderTest.java | Tests 404 behavior and logging levels. |
| MultiRolesTokenAuthorizationProviderTest.java | Tests missing-tenant handling for multi-role authorization. |
| LogCapture.java | Provides scoped Log4j2 event capture for tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
) (cherry picked from commit a25ae29)
) (cherry picked from commit a25ae29)
…che#26361) (cherry picked from commit a25ae29)
| Back | FazBrowse Home | New Git URL |
Motivation
PulsarAuthorizationProvider#validateTenantAdminAccess throws RestException(404, "Tenant does not exist") from inside thenCompose, and the exceptionally handler chained onto that same stage catches it. That handler only special-cases MetadataStoreException.NotFoundException, so the self-thrown 404 falls through to log.error("Failed to get tenant", cause).
Every request naming a tenant that does not exist therefore produces an ERROR line with a stack trace. A lookup is enough to trigger it, so a single misconfigured client pointed at a cluster that does not host its tenant can flood a healthy broker — roughly 1000 ERROR lines in 10 minutes from one client, on a broker with nothing wrong with it.
A tenant that does not exist is a client error, not a broker fault: any client can trigger it by mistyping a tenant name, and ServerCnx already reports the rejection at its own level.
MultiRolesTokenAuthorizationProvider overrides the method and carries an identical copy of the bug.
Modifications
Genuine metadata store failures are still logged at ERROR. Client-visible behaviour is unchanged: the previous code rethrew new RestException(cause), which preserved the 404 response, so the status, message and ErrorData entity are identical.
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes