[
https://issues.apache.org/jira/browse/MAPREDUCE-7547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated MAPREDUCE-7547:
--------------------------------------
Labels: pull-request-available (was: )
> HsWebApp should bind App request-scoped instead of singleton
> ------------------------------------------------------------
>
> Key: MAPREDUCE-7547
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-7547
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Components: jobhistoryserver, webapps
> Reporter: Jose Luis López
> Assignee: Jose Luis López
> Priority: Major
> Labels: pull-request-available
>
> MAPREDUCE-7527 fixed the JobHistoryServer attempts page by binding {{App}} as
> a singleton in {{HsWebApp.setup()}}:
> {code:java}
> bind(App.class).in(Singleton.class);
> {code}
> {{App}} holds per-request mutable state: {{AppController.requireJob()}} /
> {{requireTask()}} (inherited by {{HsController}}) call {{app.setJob(...)}} /
> {{app.setTask(...)}}, and the rendered view reads them back via
> {{app.getJob()}} / {{app.getTask()}}. With a singleton, every request to the
> JHS shares one {{App}} instance, so concurrent requests can overwrite each
> other's job/task and a page can render data for a different job than the one
> requested.
> The equivalent fix for the AM web UI, MAPREDUCE-7541
> (https://github.com/apache/hadoop/pull/8652), was reviewed with this exact
> concern and uses request scope instead:
> {code:java}
> bind(App.class).in(RequestScoped.class);
> {code}
> The JHS is long-lived and serves all users, so it should use the same
> request-scoped binding.
> *Proposed change*
> * In {{HsWebApp.setup()}}, change {{Singleton.class}} to
> {{com.google.inject.servlet.RequestScoped.class}}.
> * Add a regression test that starts the JHS web app and requests
> {{/jobhistory/attempts/<job_id>/m/SUCCESSFUL}}, asserting attempt rows are
> rendered (guards MAPREDUCE-7527), and ideally that two different jobs' pages
> each render their own job.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]