eukaryote opened a new pull request, #2214:
URL: https://github.com/apache/solr/pull/2214

   Avoid a `NullPointerException` that can occur under some circumstances when 
performing multiple partial updates of the same document in separate requests 
using `commitWithin`.
   
   https://issues.apache.org/jira/browse/SOLR-17120
   
   # Description
   
   When merging older partial updates into the doc for newer partial updates, 
the existing solr code would generate a `NullPointerException` under some 
circumstances when it tried to iterate over a `null` value.
   
   # Solution
   
   I replaced the loop that started with `for (Object val : 
olderDoc.getFieldValues(fieldName))` with code that first assigns the value to 
a temporary variable and then either iterates over the value (performing the 
same action as  previously on each value if it is non-nulll) or calls 
`newerDoc.addField(fieldName, null)` instead if the value is `null`.
   
   # Tests
   
   Please describe the tests you've developed or run to confirm this patch 
implements the feature or solves the problem.
   
   No tests yet, but I was able to regularly reproduce the error before, and 
have been running a patched version of a `solr-core-9.4.0-SNAPSHOT.jar` file 
that I created with this change against the 9.4.0 version and haven't been able 
to reproduce the error.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to 
Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my 
code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request 
title.
   - [x] I have given Solr maintainers 
[access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork)
 to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `main` branch.
   - [x] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   - [ ] I have added documentation for the [Reference 
Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
   
   21 tests failed, all of which were in 
`org.apache.solr.s3.S3BackupRepositoryTest` or 
`org.apache.solr.s3.S3OutputStreamTest`, which my change doesn't seem related 
to at all. I'll double-check my `~/.aws` conf files and try again.


-- 
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]

Reply via email to