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 eee18cc commit fab21c7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ 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));
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) {
final long startMs = System.currentTimeMillis();
Expand All @@ -393,7 +393,7 @@ private void setDlsHeaders(EvaluatedDlsFlsConfig dlsFls, ActionRequest request)
if (!dlsQueries.equals(deserializedDlsQueries)) {
throw new OpenSearchSecurityException(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);
Expand All @@ -402,7 +402,7 @@ private void setDlsHeaders(EvaluatedDlsFlsConfig dlsFls, ActionRequest request)
final long startMs = System.currentTimeMillis();
threadContext.putHeader(ConfigConstants.OPENDISTRO_SECURITY_DLS_QUERY_HEADER, serialized);
final long endMs = System.currentTimeMillis() - startMs;
log.error("$$$$ serialize {}ms, put header {}ms attach DLS info: {}",endMs1, endMs, dlsQueries);
// log.error("$$$$ serialize {}ms, put header {}ms attach DLS info: {}",endMs1, endMs, dlsQueries);
}
}
}
Expand Down

0 comments on commit fab21c7

Please sign in to comment.