Skip to content

Add SPI jvm option to SystemJvmOptions #50916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jan 21, 2020

Conversation

pgomulka
Copy link
Contributor

@pgomulka pgomulka commented Jan 13, 2020

Adding back accidentally removed jvm option that is required to enforce
start of the week = Monday in IsoCalendarDataProvider.
Adding a feature to yml test in order to skip running it in JDK8

commit that removed it 398c802
commit that backports SystemJvmOptions c4fbda3
relates 7.x backport of code that enforces CalendarDataProvider use #48349

Adding back accidently removed jvm options that is required to enfoce
start of the week = Monday in IsoCalendarDataProvider.
@pgomulka pgomulka added the :Core/Infra/Core Core issues without another label label Jan 13, 2020
@pgomulka pgomulka self-assigned this Jan 13, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Core)

# The inserted document has a field date=2009-11-15T14:12:12 which is Sunday.
# When aggregating per day of the week this should be considered as last day of the week (7)
# and this value should be used in 'key_as_string'
"Date aggregartion per day of week":
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Date aggregartion per day of week":
"Date aggregation per day of week":

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - as per todo this test is expected to fail in 1.8 https://github.com/elastic/elasticsearch/pull/50916/files#diff-a1dab819a2bedbcb781ecd85580cfbb5R4
I am actually not sure how to work around this, the code for using IsoCalendarDataProvider is in 7.x but because we support JDK1.8 I won't be able to always pass the build.
Any suggestions how to fix this?
I am thinking of just removing the test for now..

Copy link
Contributor Author

@pgomulka pgomulka Jan 15, 2020

Choose a reason for hiding this comment

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

@pugnascotia @rjernst what is your view on this? Maybe we should extend the testing framework to allow checking runtime jvm and skip basing on this?
how about we work around this with features ? see the latest changes

Copy link
Contributor

Choose a reason for hiding this comment

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

My feeling is that these changes are fine, but what I'm missing is some Javadoc to explain why they're necessary. Unless I have all the context around dates and JDK versions, I can't understand what the checks are for. The new feature name doesn't help here either. Can we add some more explanation into the code, to help other developers understand what is going on and why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pugnascotia good idea. will add some more javadocs as they are clearly missing

pugnascotia
pugnascotia previously approved these changes Jan 13, 2020
@pugnascotia pugnascotia dismissed their stale review January 13, 2020 15:53

I realised that CI is still failing

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

A couple comments


# due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise
# time/date parsing will break in an incompatible way for some date patterns and locals
8-:-Djava.locale.providers=SPI,JRE
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this just be 8, not 8-?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, this should just be 8 - removed in favour of conditional check in SystemJvmOptions

* Due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise time/date
* parsing will break in an incompatible way for some date patterns and locales.
*/
"-Djava.locale.providers=COMPAT"));
Copy link
Member

Choose a reason for hiding this comment

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

Why can't we keep this in system jvm options? Shouldn't this be something a user doesn't need to think about?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right, it is better to stay in SystemJvmOptions. We can always check the version running with JavaVersion.majorVersion(JavaVersion.CURRENT) == 8 to choose the right settings

@pgomulka
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/2

pgomulka and others added 2 commits January 15, 2020 13:57
…regation/310_date_agg_per_day_of_week.yml

Co-Authored-By: Rory Hunter <[email protected]>
@polyfractal polyfractal added v7.7.0 and removed v7.6.0 labels Jan 15, 2020
@pgomulka
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/2

@pgomulka
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/2

@pgomulka pgomulka merged commit 0513d8d into elastic:7.x Jan 21, 2020
pgomulka added a commit that referenced this pull request Jan 21, 2020
The test should be run against 7.7 version at least, as this was only backported and released in that version

relates SPI based implementation #48209
relates backport #50916
pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Jun 10, 2020
Adding back accidentally removed jvm option that is required to enforce
start of the week = Monday in IsoCalendarDataProvider.
Adding a `feature` to yml test in order to skip running it in JDK8

commit that removed it 398c802
commit that backports SystemJvmOptions c4fbda3
relates 7.x backport of code that enforces CalendarDataProvider use elastic#48349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label v7.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants