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

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0
    • Affects Version/s: 1.3.0
    • Component/s: Sink
    • None

      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()) {
      		...
      	}
      	...
      }
      

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

              Created:
              Updated:
              Resolved: