Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-3677

Declare proper exception type in catch block of KafkaExactlyOnceSink#initShardWriter

Details

    • Bug
    • Status: Open
    • P3
    • Resolution: Unresolved
    • None
    • None
    • io-java-kafka
    • None

    Description

            } catch (Exception e) {
              producer.close();
              throw e;
      

      initShardWriter throws IOException. The catch block shouldn't widen the exception type.
      If the intention is to properly close producer, we can use try-with-resources.

      Attachments

        Activity

          People

            Unassigned Unassigned
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: