Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-9022

fix resource close in `StreamTaskStateInitializerImpl.streamOperatorStateContext()`

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.5.0
    • 1.5.0
    • None

    Description

      We have the following code in StreamTaskStateInitializerImpl.streamOperatorStateContext() which is incorrect:

      } 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);
      }
      

      Attachments

        Issue Links

          Activity

            People

              srichter Stefan Richter
              sihuazhou Sihua Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: