Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-12151

Closing the TopologyTestDriver from kafka-streams-test-utils raises UnsupportedOperationException

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 2.6.0
    • Fix Version/s: None
    • Component/s: streams-test-utils
    • Labels:
      None

      Description

      Following the documentation for testing kafka streams: https://kafka.apache.org/26/documentation/streams/developer-guide/testing.html

       

      When running 
       testDriver.close();
      throws an exception.

      java.lang.UnsupportedOperationException: Removing from registeredStores is not allowedjava.lang.UnsupportedOperationException: Removing from registeredStores is not allowed at org.apache.kafka.common.utils.FixedOrderMap.clear(FixedOrderMap.java:56) at org.apache.kafka.streams.processor.internals.ProcessorStateManager.close(ProcessorStateManager.java:499) at org.apache.kafka.streams.processor.internals.StateManagerUtil.closeStateManager(StateManagerUtil.java:106) at org.apache.kafka.streams.processor.internals.StreamTask.lambda$close$0(StreamTask.java:574) at org.apache.kafka.streams.processor.internals.TaskManager.executeAndMaybeSwallow(TaskManager.java:1155) at org.apache.kafka.streams.processor.internals.TaskManager.executeAndMaybeSwallow(TaskManager.java:1169) at org.apache.kafka.streams.processor.internals.StreamTask.close(StreamTask.java:572) at org.apache.kafka.streams.processor.internals.StreamTask.closeClean(StreamTask.java:501) at org.apache.kafka.streams.TopologyTestDriver.close(TopologyTestDriver.java:1180)
      

      The ProcessorStateManager.close is calling stores.clear(); however stores is of type FixedOrderMap which implements

      @Deprecated 
      @Override 
      public void clear() { throw new UnsupportedOperationException("Removing from registeredStores is not allowed"); }
      

      and therefore can only ever fail. This worked fine with version 2.5

      {{}}

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jan101 Jan Teichmann

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment