Copilot commented on code in PR #5079:
URL: https://github.com/apache/solr/pull/5079#discussion_r4235508491
##########
solr/core/src/java/org/apache/solr/update/processor/SignatureUpdateProcessorFactory.java:
##########
@@ -188,6 +188,12 @@ public void processAdd(AddUpdateCommand cmd) throws
IOException {
}
}
+ if (isPartialUpdate) {
+ // none of the signature fields are in the partial update, so there
is nothing to sign;
+ // an empty signature would overwrite or delete unrelated documents
+ if (next != null) next.processAdd(cmd);
+ return;
Review Comment:
This guard is reached only after `newInstance(signatureClass, ...)` and
`sig.init(params)`, so a partial update that contains none of the configured
signature fields still constructs and initializes the configured Signature
implementation. A custom implementation can perform expensive work or throw
from `init`, which contradicts the stated pass-through behavior; determine that
no signature field is present and return to `next` before
constructing/initializing `sig`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]