kaliop-uk / ezmigrationbundle

This bundle makes it easy to handle eZPlatform / eZPublish5 content upgrades/migrations
GNU General Public License v2.0
53 stars 81 forks source link

java.lang.NegativeArraySizeException SOLR multi core error #207

Closed SerheyDolgushev closed 5 years ago

SerheyDolgushev commented 5 years ago

2147483647 limit is causing java.lang.NegativeArraySizeException if you have multiple cores

gggeek commented 5 years ago

Added to Master a workaround by making the value used as query limit a parameter. Documented in the FAQ section of the README. The process to set the correct value to the parameter is left to the developer.

Is that ok or do you envision a better approach/solution?

gggeek commented 5 years ago

Implemented in 5.10

SerheyDolgushev commented 5 years ago

I was thinking about something like:

$this->queryLimit = floor(self::INT_MAX_16BIT/SOLR_CORES_COUNT);

But query limit options sounds also like a good solution for this kind rare cases.

gggeek commented 5 years ago

That would also work, with the caveat of having most likely to check if that constant is defined before using it - and trusting that it will always be there and used for the desired purpose (eg. there's lots of renaming going on in the latest ezplatform version atm, so I am not 1000% sure about that going forward...). Also, using a parameter is slightly more cumbersome for the developer, but it gives her more flexibility if any special cases arise in the future.