[ 
https://issues.apache.org/jira/browse/FLINK-6627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16276859#comment-16276859
 ] 

Nico Kruber commented on FLINK-6627:
------------------------------------

Although not being ideal, a workaround for now may be to parse the log files 
for messages like
{quote}
2017-12-04 08:48:30,197 INFO  org.apache.flink.runtime.blob.BlobServer          
            - Created BLOB server storage directory 
/tmp/blobStore-81cd12c7-394e-4777-85a1-98389b72dd08
{quote}
or {quote}
2017-12-04 08:53:55,752 INFO  org.apache.flink.runtime.blob.PermanentBlobCache  
            - Created BLOB cache storage directory 
/tmp/blobStore-39a9ec2f-32ff-4a31-a1e5-03294cd3cea5
2017-12-04 08:53:55,776 INFO  org.apache.flink.runtime.blob.TransientBlobCache  
            - Created BLOB cache storage directory 
/tmp/blobStore-8d7c8660-4455-43e9-93be-dadeb622b9e1
{quote}
which are written at INFO level into the job/task manager logs from the 
{{BlobServer}, {{PermanentBlobCache}}, and {{TransientBlobCache}} in Flink 1.4 
(at least). But there is no guarantee this message won't change at any point in 
future.

> Expose tmp directories via API
> ------------------------------
>
>                 Key: FLINK-6627
>                 URL: https://issues.apache.org/jira/browse/FLINK-6627
>             Project: Flink
>          Issue Type: Improvement
>          Components: Local Runtime
>    Affects Versions: 1.2.0, 1.3.0, 1.2.1, 1.3.1, 1.4.0, 1.3.2
>            Reporter: Andrey
>
> Currently tmp/blob directories created based on fixed baseDir and random 
> postfix. For example blob directory:
> {code}
> new File(baseDir, String.format("blobStore-%s", UUID.randomUUID().toString()))
> {code}
> This directory name is not exposed externally. This will cause several issues 
> in the following scenario:
> 1) Start 1 task manager
> 2) random blob directory created. For example: "blob-1"
> 3) Start 2 task manager
> 4) random blob directory created. For example: "blob-2"
> 5) 1 task manager dies unexpectedly. (kill -9 or OOM).
> 6) directory "blob-1" will not be deleted.
> 7) 1 task manager automatically restarted
> 8) random blob directory created. For example: "blob-3"
> The issues:
> * The directory "blob-1" will never be deleted. 
> * The external cleanup script cannot get information about current 
> directories being in use. Because information is not exposed externally. So 
> it cannot delete unused directories.
> * Sorting directories by "created time" and keeping last X, won't help, 
> because 1 faulty task manager could generate X+1 new directories.
> * giving different "blob.storage.directory" for different task managers is 
> not a scalable solution for cloud/docker deployment, because there should be 
> central storage for current number of running task managers.
> Proposed solution:
> * expose via rest API current working directory for blob/tmp. In that case: 
> ** cleanup script could get all blob/tmp directories being in use from the 
> cluster
> ** get all blob/tmp directories ("ls")
> ** find blob/tmp directories not being used. 
> ** delete them



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to