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

errors.log.enable=true does not log Exception when errors.tolerance=all

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.4.0
    • 1.3.0
    • Sink
    • None

    Description

      Documentation says :

      errors.log.enable: When set to true, both errors that are tolerated (determined by the errors.tolerance setting) and not tolerated are written.

      But:

      When settings errors.tolerance=all and errors.log.enable=true Then only MongoException are logged.

       

      Cause probably is in catch block in com.mongodb.kafka.connect.sink.MongoSinkTask.processSinkRecords(MongoSinkTopicConfig config, List<SinkRecord> batch)

      private void processSinkRecords(final MongoSinkTopicConfig config, final List<SinkRecord> batch) {
      	...
      	try {
      		...
      	} catch (MongoException e) {
      		...
       		handleMongoException(config, e);
       	} catch (Exception e) {
       		if (!config.tolerateErrors()) {
      			...
      		}
      	}
      }
       
      private void handleMongoException(final MongoSinkTopicConfig config, final MongoException e) {
      	...
      	if (config.logErrors()) {
      		...
      	}
      	if (!config.tolerateErrors()) {
      		...
      	}
      	...
      }
      

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            louis.devergnies@ext.adeo.com Louis DEVERGNIES
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: