You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "sonatype-lift[bot] (via GitHub)" <gi...@apache.org> on 2023/06/09 04:42:59 UTC
[GitHub] [solr] sonatype-lift[bot] commented on a diff in pull request #1697: SOLR-16812: Reference guide
sonatype-lift[bot] commented on code in PR #1697:
URL: https://github.com/apache/solr/pull/1697#discussion_r1223836923
##########
solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java:
##########
@@ -747,8 +787,11 @@ private void remoteQuery(String coreUrl, HttpServletResponse resp) throws IOExce
if (httpEntity != null) {
if (httpEntity.getContentEncoding() != null)
- resp.setHeader(httpEntity.getContentEncoding().getName(), httpEntity.getContentEncoding().getValue());
- if (httpEntity.getContentType() != null) resp.setContentType(httpEntity.getContentType().getValue());
+ resp.setHeader(
Review Comment:
<picture><img alt="0% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/0/display.svg"></picture>
<b>*CROSS_SITE_SCRIPTING:</b>* UserControlledString(HttpServletRequest.getHeader(...)) at line 754 ~> HTML(HttpServletResponse.setHeader(...)) at line 790.
ââ <b>3 similar findings have been found in this PR</b>
<details><summary>đ Expand here to view all instances of this finding</summary><br/>
<div align=\"center\">
| **File Path** | **Line Number** |
| ------------- | ------------- |
| solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java | [550](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java#L550) |
| solr/core/src/java/org/apache/solr/security/AuthorizationUtils.java | [84](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/security/AuthorizationUtils.java#L84) |
| solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java | [790](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java#L790) |
<p><a href="https://lift.sonatype.com/results/github.com/apache/solr/01H2F0S3JBXNB4STQVAF6ES1N6?t=Infer|CROSS_SITE_SCRIPTING" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
---
<details><summary>âšī¸ Expand to see all <b>@sonatype-lift</b> commands</summary>
You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
##########
solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java:
##########
@@ -643,53 +866,80 @@ private void handleFailureOnAsyncRequest(NamedList<?> results, String msgOnError
}
// public and static to facilitate reuse in the simulation framework and in tests
- public static void checkDiskSpace(String collection, String shard, Replica parentShardLeader, SolrIndexSplitter.SplitMethod method, SolrCloudManager cloudManager) throws SolrException {
+ public static void checkDiskSpace(
+ String collection,
+ String shard,
+ Replica parentShardLeader,
+ SolrIndexSplitter.SplitMethod method,
+ SolrCloudManager cloudManager)
+ throws SolrException {
// check that enough disk space is available on the parent leader node
// otherwise the actual index splitting will always fail
NodeStateProvider nodeStateProvider = cloudManager.getNodeStateProvider();
- Map<String, Object> nodeValues = nodeStateProvider.getNodeValues(parentShardLeader.getNodeName(),
- Collections.singletonList(ImplicitSnitch.DISK));
- Map<String, Map<String, List<Replica>>> infos = nodeStateProvider.getReplicaInfo(parentShardLeader.getNodeName(),
- Collections.singletonList(CORE_IDX.metricsAttribute));
+ Map<String, Object> nodeValues =
+ nodeStateProvider.getNodeValues(
+ parentShardLeader.getNodeName(), Collections.singletonList(ImplicitSnitch.DISK));
+ Map<String, Map<String, List<Replica>>> infos =
+ nodeStateProvider.getReplicaInfo(
+ parentShardLeader.getNodeName(), Collections.singletonList(CORE_IDX.metricsAttribute));
if (infos.get(collection) == null || infos.get(collection).get(shard) == null) {
- throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "missing replica information for parent shard leader");
+ log.warn("cannot verify information for parent shard leader");
+ return;
}
// find the leader
List<Replica> lst = infos.get(collection).get(shard);
Double indexSize = null;
for (Replica info : lst) {
Review Comment:
<picture><img alt="7% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/7/display.svg"></picture>
<b>*NULLPTR_DEREFERENCE:</b>* `lst` could be null (last assigned on line 890) and is dereferenced.
---
<details><summary>âšī¸ Expand to see all <b>@sonatype-lift</b> commands</summary>
You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
##########
solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessor.java:
##########
@@ -63,41 +62,35 @@ public void processMergeIndexes(MergeIndexesCommand cmd) throws IOException {
if (next != null) next.processMergeIndexes(cmd);
}
- public void processCommit(CommitUpdateCommand cmd) throws IOException
- {
+ public void processCommit(CommitUpdateCommand cmd) throws IOException {
if (next != null) next.processCommit(cmd);
}
/**
* @since Solr 1.4
Review Comment:
<picture><img alt="33% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/33/display.svg"></picture>
<b>*[MissingSummary](https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment):</b>* A summary line is required on public/protected Javadocs.
ââ <b>7 similar findings have been found in this PR</b>
<details><summary>đ Expand here to view all instances of this finding</summary><br/>
<div align=\"center\">
| **File Path** | **Line Number** |
| ------------- | ------------- |
| solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java | [282](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java#L282) |
| solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java | [273](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java#L273) |
| solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java | [265](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java#L265) |
| solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java | [305](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java#L305) |
| solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java | [290](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java#L290) |
| solr/core/src/java/org/apache/solr/schema/IndexSchema.java | [415](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/schema/IndexSchema.java#L415) |
| solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java | [231](https://github.com/apache/solr/blob/24fa8ba8de40501ced19cc71e2c5600c74815621/solr/core/src/java/org/apache/solr/handler/component/RangeFacetRequest.java#L231) |
<p><a href="https://lift.sonatype.com/results/github.com/apache/solr/01H2F0S3JBXNB4STQVAF6ES1N6?t=ErrorProne|MissingSummary" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
---
<details><summary>âšī¸ Expand to see all <b>@sonatype-lift</b> commands</summary>
You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org