Skip to content
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

Fix date time JSON parsing #2007

Merged
merged 3 commits into from Apr 7, 2016
Merged

Fix date time JSON parsing #2007

merged 3 commits into from Apr 7, 2016

Conversation

@bernd
Copy link
Member

@bernd bernd commented Mar 31, 2016

  1. Disables the ADJUST_DATES_TO_CONTEXT_TIME_ZONE setting for the jackson ObjectMapper.
  2. Fixes AbsoluteRange#parseDateTime() to not lose time zone information.

See commit messages for details.

bernd added 2 commits Mar 31, 2016
Without disabling this, every DateTime object will be adjusted to the
"context provided java.utilTimeZone" on deserialization. We lose the
original time zone information.

Example:

"2016-03-24T00:00:00.000+09:00" becomes "2016-03-23T16:00:00.000+01:00"

(on my machine)

See javadoc for DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE
for details.
@bernd bernd added this to the 2.0.0 milestone Mar 31, 2016
@bernd
Copy link
Member Author

@bernd bernd commented Mar 31, 2016

I think having ADJUST_DATES_TO_CONTEXT_TIME_ZONE enabled (which is the default) doesn't really make sense because the result depends on the context time zone which might be different on different machines and thus makes the result unpredictable.

@joschi
Copy link
Contributor

@joschi joschi commented Mar 31, 2016

Some time-related tests are now failing:

Results :

Failed tests:
  SearchesTest.testFieldHistogram:372 expected:<...e=absolute, from=201[5-01-01T00:00:00.000+01:00, to=2015-01-02T00:00:00.000+01:00]}> but was:<...e=absolute, from=201[4-12-31T23:00:00.000Z, to=2015-01-01T23:00:00.000Z]}>
  SearchesTest.testHistogram:303 expected:<...e=absolute, from=201[5-01-01T00:00:00.000+01:00, to=2015-01-02T00:00:00.000+01:00]}> but was:<...e=absolute, from=201[4-12-31T23:00:00.000Z, to=2015-01-01T23:00:00.000Z]}>
  SearchesTest.testHistogramWithNonExistingIndex:336 expected:<...e=absolute, from=201[5-01-01T00:00:00.000+01:00, to=2015-01-02T00:00:00.000+01:00]}> but was:<...e=absolute, from=201[4-12-31T23:00:00.000Z, to=2015-01-01T23:00:00.000Z]}>
@bernd
Copy link
Member Author

@bernd bernd commented Mar 31, 2016

@joschi Thanks, I fixed the tests.

@joschi joschi self-assigned this Apr 4, 2016
@joschi
Copy link
Contributor

@joschi joschi commented Apr 7, 2016

LGTM. 👍

@joschi joschi merged commit 4201a03 into master Apr 7, 2016
4 checks passed
4 checks passed
ci-server-integration Jenkins build graylog2-server-integration-pr 780 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 269 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@joschi joschi deleted the fix-date-time-json-parsing branch Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.