Skip to content

Commit

Permalink
Correcting failure logging (opensearch-project#35)
Browse files Browse the repository at this point in the history
* Not logging job doc when failed to parse job, but instead just the id to prevent leaking information

Signed-off-by: Ravi Thaluru <ravi1092@gmail.com>
  • Loading branch information
thalurur committed May 28, 2021
1 parent 37b8cb1 commit 116d8b4
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.opensearch.cluster.routing.Murmur3HashFunction;
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.Strings;
import org.opensearch.common.bytes.BytesReference;
import org.opensearch.common.component.LifecycleListener;
import org.opensearch.common.settings.Settings;
Expand Down Expand Up @@ -277,8 +276,7 @@ void sweep(ShardId shardId, String docId, BytesReference jobSource, JobDocVersio
}
return jobDocVersion;
} catch (Exception e) {
log.warn("Unable to parse job, error message: {} , message source: {}", e.getMessage(),
Strings.cleanTruncate(jobSource.utf8ToString(), 1000));
log.warn("Unable to parse job {}, error message: {}", docId, e.getMessage());
return currentJobDocVersion;
}
} else {
Expand Down

0 comments on commit 116d8b4

Please sign in to comment.