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

Logging: Fix crash when Epoch-based timestamps are used with JSON #3281

Merged
merged 1 commit into from Aug 10, 2021

Conversation

dumbbell
Copy link
Member

@dumbbell dumbbell commented Aug 9, 2021

The code was passing a number (the timestamp) to unicode:characters_to_binary/1 which expects an iolist to convert to UTF-8.

We now verify if we have a number before calling that function. If this is a number (integer or float), we keep it as is because JSON supports that type.

The code was passing a number (the timestamp) to
unicode:characters_to_binary/1 which expects an iolist to convert to
UTF-8.

We now verify if we have a number before calling that function. If this
is a number (integer or float), we keep it as is because JSON supports
that type.
@dumbbell dumbbell force-pushed the fix-epoch-timestamp-crash-in-json-logging branch from 5131f9a to 6c8cf4c Compare August 10, 2021 10:34
@dumbbell dumbbell marked this pull request as ready for review August 10, 2021 11:32
@dumbbell dumbbell merged commit c2ea12b into master Aug 10, 2021
@dumbbell dumbbell deleted the fix-epoch-timestamp-crash-in-json-logging branch August 10, 2021 11:32
@dumbbell
Copy link
Member Author

@Mergifyio backport v3.9.x

@mergify
Copy link

mergify bot commented Aug 10, 2021

Command backport v3.9.x: success

Backports have been created

michaelklishin added a commit that referenced this pull request Aug 10, 2021
Logging: Fix crash when Epoch-based timestamps are used with JSON (backport #3281)
ansd added a commit to rabbitmq/cluster-operator that referenced this pull request Aug 23, 2021
since rabbitmq/rabbitmq-server#3281 and
rabbitmq/rabbitmq-server#3283 are merged.

Example log output:
{"v":7,"time":1629703633887530,"msg":"accepting AMQP connection <0.1321.0> (10.244.0.1:43532 -> 10.244.0.14:5672)","domain":"rabbitmq.connection","pid":"<0.1321.0>","gl":"<0.223.0>"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant