Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion solr/core/src/java/org/apache/solr/core/NodeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ public static class NodeConfigBuilder {
private String defaultZkHost;
private Set<Path> allowPaths = Collections.emptySet();
private List<String> allowUrls = Collections.emptyList();
private boolean hideStackTrace = Boolean.getBoolean("solr.hideStackTrace");
private boolean hideStackTrace =
!(Boolean.parseBoolean(System.getProperty("solr.responses.stacktrace.enabled", "true")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EnvUtils?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!


private final Path solrHome;
private final String nodeName;
Expand Down
6 changes: 6 additions & 0 deletions solr/solrj/src/java/org/apache/solr/common/util/EnvUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ static synchronized void init(
deprecatedKey,
key);
setProperty(key, String.valueOf(!Boolean.getBoolean(deprecatedKey)));
} else if (deprecatedKey.equals("solr.hide.stack.trace")) {
log.warn(
"Converting from legacy system property {} to modern .enabled equivalent {} by flipping the boolean property value.",
deprecatedKey,
key);
setProperty(key, String.valueOf(!Boolean.getBoolean(deprecatedKey)));
} else {
setProperty(key, sysProperties.getProperty(deprecatedKey));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ solr.enable.remote.streaming=solr.requests.streaming.remote.enabled
solr.enable.stream.body=solr.requests.streaming.body.enabled
solr.delete.unknown.cores=solr.cloud.startup.delete.unknown.cores.enabled
solr.config.set.forbidden.file.types=solr.configset.forbidden.file.types
solr.hide.stack.trace=solr.responses.stacktrace.enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be neat if there was a way to reflect that we inverted a boolean. Like use an exclamation in the beginning.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a bad idea.. Maybe if the line starts with a ! then you know while processing that it's an inversion. That would simplify the rule logic in EnvUtils.java.. This is a great idea.

Loading