Menu

#60 GUIReplayer - Properly Cleaning Up the Monitor

open-fixed
nobody
None
5
2011-03-02
2011-01-22
No

The replayer execute calls the replayer monitor's setUp method, performs some actions, then calls cleanUp. If a problem ever occurs, cleanUp is not called. This is akin to opening a file and not closing it.

Attached is a patch that properly implements the try/catch/finally pattern.

Potential issues with this is if cleanUp requires setUp to set a variable and setUp fails, then cleanUp can't rely on everything being up and running. This mostly means that cleanUp may need to check if a resource was initialized before trying to clean it up.

Discussion

  • Jonathan Sternberg

     
  • Jonathan Sternberg

     
  • Jonathan Sternberg

    The patch may effect the JFC Replayer Plugin. If the JFC code fails before saving the current security manager, then it will not properly reset the security manager. It will reset it to null. The only call that occurs before that is Thread.setDefaultUncaughtExceptionHandler which can throw a SecurityException. If this SecurityException is thrown, then the SecurityManager will not be saved and will be set to null by the cleanup. Attached is a fix for this problem.

     
  • Jonathan Sternberg

    Patch applied.

     
  • Jonathan Sternberg

    • status: open --> open-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB