TisonKun opened a new pull request #7501: [FLINK-11343] Omit actions in memory 
manager after shutdown instead o…
URL: https://github.com/apache/flink/pull/7501
 
 
   …f IllegalStateException
   
   ## What is the purpose of the change
   
   >org.apache.flink.runtime.util.TestingFatalErrorHandler$TestingException: 
java.lang.IllegalStateException: Memory manager has been shut down.
        at 
org.apache.flink.runtime.util.TestingFatalErrorHandler.rethrowError(TestingFatalErrorHandler.java:51)
        at 
org.apache.flink.runtime.taskexecutor.TaskExecutorTest.teardown(TaskExecutorTest.java:223)
   Caused by: java.lang.IllegalStateException: Memory manager has been shut 
down.
        at 
org.apache.flink.runtime.memory.MemoryManager.releaseAll(MemoryManager.java:480)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:821)
        at java.lang.Thread.run(Thread.java:748)
   
   After an investigation, I notice that it occurred when
   
   1. Task#run set task state as FINISHED
   2. Test case get the FINISHED future, call taskExecutor#shutdown, so the 
MemoryManager shutdown.
   3. In `finally` block of Task#run, call MemoryManager#releaseAll(owner)
   4. cause `IllegalStateException`
   
   Here, I find that after MemoryManager#shutdown, `allocatedSegments` and 
`memoryPool` are released properly. Thus a following #releaseAll can be safely 
omitted and an `IllegalStateException` is no-need.
   
   ## Brief change log
   
   Omit actions in memory manager after shutdown instead of throwing 
IllegalStateException
   
   
   ## Verifying this change
   
   This change is already covered by existing tests, such as *TaskExecutorTest*.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to