flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Richter (JIRA)" <j...@apache.org>
Subject [jira] [Reopened] (FLINK-9022) fix resource close in `StreamTaskStateInitializerImpl.streamOperatorStateContext()`
Date Thu, 19 Apr 2018 08:22:00 GMT

     [ https://issues.apache.org/jira/browse/FLINK-9022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefan Richter reopened FLINK-9022:
-----------------------------------
      Assignee: Stefan Richter  (was: Sihua Zhou)

Reopened because the dispose of backends should always happen, not only if we can unregister
them from the closeable registry. For example, cancellation can close the registry and cause
an exception in restoring the backend. In this case, the backend is already unregistered
but we still want to call dispose.

> fix resource close in `StreamTaskStateInitializerImpl.streamOperatorStateContext()`
> -----------------------------------------------------------------------------------
>
>                 Key: FLINK-9022
>                 URL: https://issues.apache.org/jira/browse/FLINK-9022
>             Project: Flink
>          Issue Type: Bug
>          Components: State Backends, Checkpointing
>    Affects Versions: 1.5.0
>            Reporter: Sihua Zhou
>            Assignee: Stefan Richter
>            Priority: Blocker
>             Fix For: 1.5.0
>
>
> We have the following code in {{StreamTaskStateInitializerImpl.streamOperatorStateContext()}}
which is incorrect:
> {code}
> } catch (Exception ex) {
> 	// cleanup if something went wrong before results got published.
> 	if (streamTaskCloseableRegistry.unregisterCloseable(keyedStatedBackend)) {
> 		IOUtils.closeQuietly(keyedStatedBackend);
> 	}
> 	if (streamTaskCloseableRegistry.unregisterCloseable(operatorStateBackend)) {
> 		IOUtils.closeQuietly(keyedStatedBackend); // this should close operatorStateBackend
> 	}
> 	if (streamTaskCloseableRegistry.unregisterCloseable(rawKeyedStateInputs)) {
> 		IOUtils.closeQuietly(rawKeyedStateInputs);
> 	}
> 	if (streamTaskCloseableRegistry.unregisterCloseable(rawOperatorStateInputs)) {
> 		IOUtils.closeQuietly(rawOperatorStateInputs);
> 	}
> 	if (streamTaskCloseableRegistry.unregisterCloseable(rawOperatorStateInputs)) {
> 		IOUtils.closeQuietly(rawOperatorStateInputs);
> 	}
> 	throw new Exception("Exception while creating StreamOperatorStateContext.", ex);
> }
> {code}	



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message