joseluisll opened a new pull request, #8790: URL: https://github.com/apache/hadoop/pull/8790
### Description of PR JIRA: https://issues.apache.org/jira/browse/MAPREDUCE-7547 MAPREDUCE-7527 (#8285) fixed the JobHistoryServer attempts page by binding `App` as a singleton in `HsWebApp`. `App` carries per-request state: `AppController.requireJob()`/`requireTask()` (inherited by `HsController`) call `app.setJob()`/`app.setTask()`, and the view reads them back. As a singleton, that state is shared by every concurrent JHS request, so one request can render another request's job. This binds `App` request-scoped instead, matching what was agreed for the AM web UI in MAPREDUCE-7541 (#8652). ### How was this patch tested? Added two tests to `TestHSWebApp`: - `testAppBindingIsRequestScoped` checks the `App` binding's scope through the Guice SPI. It fails with the previous `Singleton` binding and with no binding at all. - `testAttemptsPageRender` starts a real `HsWebApp` on mock jobs and requests `/jobhistory/attempts/<job>/m/<state>`, asserting HTTP 200 and that a known attempt id is listed. It fails without the `App` binding, which guards the MAPREDUCE-7527 fix. `mvn test -Dtest=TestHSWebApp` in `hadoop-mapreduce-client-hs`: 19 tests, 0 failures. ### For code changes: - [x] Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')? - [ ] Object storage: Have the integration tests been executed and the endpoint declared according to the connector-specific documentation? *Note: Automated CI testing doesn't cover all cases so manual testing with cloud storage is still required.* - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files? ### AI Tooling If an AI tool was used: - [x] The PR includes the phrase "Contains content generated by <tool>" where <tool> is the name of the AI tool used. - [ ] My use of AI contributions follows the ASF legal policy https://www.apache.org/legal/generative-tooling.html Contains content generated by Claude Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
