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

Stefan Richter commented on FLINK-7880:
---------------------------------------

My theory is that the `dispose()` is not properly executed before the test 
finishes. By adding printouts to the backend's constructor, dispose(), and the 
code that waits for cancelation like this:

{code}
                } finally {
                        System.out.println("shutdown a");
                        // Free cluster resources
                        if (jobId != null) {
                                CompletableFuture<CancellationSuccess> 
cancellation = FutureUtils.toJava(cluster
                                                
.getLeaderGateway(deadline.timeLeft())
                                                .ask(new 
JobManagerMessages.CancelJob(jobId), deadline.timeLeft())
                                                
.mapTo(ClassTag$.MODULE$.<CancellationSuccess>apply(CancellationSuccess.class)));

                                
cancellation.get(deadline.timeLeft().toMillis(), TimeUnit.MILLISECONDS);
                        }
                        System.out.println("shutdown b");
                }

{code}

I obtain the following printing order:


{code}
created 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@58482c7d
created 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@5278696f
created 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@11c418d8
created 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@78424ca5
created 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@79690844
created 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@44855a3
created 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@459dcdef
created 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@54cef1d0
shutdown a
shutdown b
dispose 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@11c418d8
dispose 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@79690844
dispose 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@58482c7d
dispose 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@44855a3
dispose 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@78424ca5
dispose 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@5278696f
dispose 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@459dcdef
dispose 
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend@54cef1d0
{code}

I conclude that the way in which the tests waits for cancelation does not work 
as expected. In particular, it does not ensure that `dispose()` was executed 
before the method ends and this can lead to problems with the native resources 
like what you observe.

> flink-queryable-state-java fails with core-dump
> -----------------------------------------------
>
>                 Key: FLINK-7880
>                 URL: https://issues.apache.org/jira/browse/FLINK-7880
>             Project: Flink
>          Issue Type: Bug
>          Components: Queryable State, Tests
>    Affects Versions: 1.4.0
>            Reporter: Till Rohrmann
>            Assignee: Kostas Kloudas
>            Priority: Blocker
>              Labels: test-stability
>             Fix For: 1.4.0
>
>
> The {{flink-queryable-state-java}} module fails on Travis with a core dump.
> https://travis-ci.org/tillrohrmann/flink/jobs/289949829



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

Reply via email to