Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19591#discussion_r158316971
  
    --- Diff: 
launcher/src/main/java/org/apache/spark/launcher/LauncherServer.java ---
    @@ -210,8 +209,13 @@ int getPort() {
        * Removes the client handle from the pending list (in case it's still 
there), and unrefs
        * the server.
        */
    -  void unregister(ChildProcAppHandle handle) {
    -    pending.remove(handle.getSecret());
    +  void unregister(AbstractAppHandle handle) {
    +    for (Map.Entry<String, AbstractAppHandle> e : pending.entrySet()) {
    --- End diff --
    
    ok one more try --
    
    you are generating a secret whether its in-process or a child process, so 
why not store that secret in AbstractAppHandle?  this isn't really a big deal, 
the efficiency difference doesn't matter, but the one line 
`pending.remove(handle.getSecret())` is also easier to follow.
    
    also could you rename `pending` to `secretToPendingApps` so its a more 
clear what the key is.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to