Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-5156 Options for handling exceptions in streams
  3. KAFKA-5006

KeyValueStore.put may throw exception unrelated to the current put attempt



    • Type: Sub-task
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s:,,
    • Fix Version/s: 1.0.0
    • Component/s: streams
    • Labels:


      It is possible for KeyValueStore.put(K key, V value) to throw an exception unrelated to the store in question. Due to the way that RecordCollector.send is currently implemented
      the exception thrown would be for any previous record produced by the stream task, possibly for a completely unrelated topic the same task is producing to.

      This can be very confusing for someone attempting to correctly handle exceptions thrown by put(), as they would not be able to add any additional debugging information to understand the operation that caused the problem. Worse, such logging would likely confuse the user, since they might mislead themselves into thinking the changelog record created by calling put() caused the problem.

      Given that there is likely no way for the user to recover from an exception thrown by an unrelated produce request, it is questionable whether we should even try to raise the exception at this level. A short-term fix would be to simply delegate this exception to the uncaught exception handler.


          Issue Links



              • Assignee:
                guozhang Guozhang Wang
                xvrl Xavier Léauté
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created: