Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-1438

Wrong interrupt handling

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 0.10.0.CR2
    • 0.10.0.Beta4
    • core-library
    • None

      Debezium codebase has many occurrences of this pattern:

      try {
        [...]
      } catch (InterruptedException e) {	
        Thread.interrupted();
        [...]
      }
      

      The intent is to restore the interrupt flag, however Thread.interrupted(); does not do that. It just checks whether there is currently the flag set (and clears is as a side-effect)

      The right set the interrupt flag on it's own thread is Thread.currentThread().interrupt()

              Unassigned Unassigned
              jerrinot Jaromir Hamala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: