Copilot commented on code in PR #8652:
URL: https://github.com/apache/hadoop/pull/8652#discussion_r3701582085


##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/AMWebApp.java:
##########
@@ -38,6 +40,7 @@ public AMWebApp(AppContext appContext) {
 
   @Override
   public void setup() {
+    bind(App.class).in(Singleton.class);
     bind(AppContext.class).toInstance(appContext);

Review Comment:
   Binding App as a Guice Singleton is unsafe here because App holds mutable 
per-request state (job/task via setJob/setTask). With a Singleton, concurrent 
requests can overwrite each other’s job/task and leak state across 
users/requests; the Attempts page needs a single shared App *per request*, not 
globally. Use Guice’s `@RequestScoped` instead (WebApp is a ServletModule so 
request scope is available).



-- 
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]

Reply via email to