Skip to content

Commit

Permalink
Disable all logging statements to prevent broad perf impact
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Nov 30, 2023
1 parent 2c74f3f commit 63db6f3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,15 @@ private void setDlsHeaders(EvaluatedDlsFlsConfig dlsFls, ActionRequest request)
final long startgetDlsQueriesByIndexMs = System.currentTimeMillis();
Map<String, Set<String>> dlsQueries = dlsFls.getDlsQueriesByIndex();
final long endgetDlsQueriesByIndexMs = System.currentTimeMillis() - startgetDlsQueriesByIndexMs;
log.error("$$$$ Timeto compute dls queries by index, {}ms", endgetDlsQueriesByIndexMs);
// log.error("$$$$ Timeto compute dls queries by index, {}ms", endgetDlsQueriesByIndexMs);

if (request instanceof ClusterSearchShardsRequest && HeaderHelper.isTrustedClusterRequest(threadContext)) {
threadContext.addResponseHeader(
ConfigConstants.OPENDISTRO_SECURITY_DLS_QUERY_HEADER,
Base64Helper.serializeObject((Serializable) dlsQueries)
);
// if (log.isDebugEnabled()) {
log.error("$$$$added response header for DLS info: {}", dlsQueries);
// log.error("$$$$added response header for DLS info: {}", dlsQueries);
// }
} else {
if (threadContext.getHeader(ConfigConstants.OPENDISTRO_SECURITY_DLS_QUERY_HEADER) != null) {
Expand All @@ -457,7 +457,7 @@ private void setDlsHeaders(EvaluatedDlsFlsConfig dlsFls, ActionRequest request)
ConfigConstants.OPENDISTRO_SECURITY_DLS_QUERY_HEADER + " does not match (SG 900D)"
);
}
log.error("$$$$ {}ms found dls query header: {}", endMs, deserializedDlsQueries);
// log.error("$$$$ {}ms found dls query header: {}", endMs, deserializedDlsQueries);
} else {
final long startMs1 = System.currentTimeMillis();
final String serialized = Base64Helper.serializeObject((Serializable) dlsQueries, false);
Expand All @@ -470,7 +470,7 @@ private void setDlsHeaders(EvaluatedDlsFlsConfig dlsFls, ActionRequest request)
);
final long endMs = System.currentTimeMillis() - startMs;
// if (log.isDebugEnabled()) {
log.error("$$$$ serialized {}ms, header in {}ms attach DLS info: {}", endMs1, endMs, dlsQueries);
// log.error("$$$$ serialized {}ms, header in {}ms attach DLS info: {}", endMs1, endMs, dlsQueries);
// }
}
}
Expand Down

0 comments on commit 63db6f3

Please sign in to comment.