Skip to content

Let the JSON reader recover from unexpected inputs #1386

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 5 commits into from
Feb 17, 2021

Conversation

tobim
Copy link
Member

@tobim tobim commented Feb 17, 2021

📔 Description

📝 Checklist

  • All user-facing changes have changelog entries.

@tobim tobim added the bug Incorrect behavior label Feb 17, 2021
@tobim tobim requested a review from a team February 17, 2021 14:07
@tobim tobim mentioned this pull request Feb 17, 2021
1 task
@tobim tobim enabled auto-merge February 17, 2021 14:10
@tobim tobim disabled auto-merge February 17, 2021 14:11
The new JSON reader returned to early in case the parsed input
could not be converted to the target type dictated by the layout.
This could lead to broken table slices with underful rows.

From now on it inserts a `nil` value into that cell and continues.
@tobim tobim force-pushed the topic/fix-json-reader-convert branch from cfd6a64 to 1d97541 Compare February 17, 2021 14:22
Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

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

I tested this locally with the example you gave me via Slack (see below, write_ts in line 2) and was able to reproduce the faulty behavior on master and the warning with this PR.

{"_path":"sip","_system_name":"sensor_10_0_0_2","_write_ts":"2021-02-01T13:23:04.768321Z","ts":"2021-02-01T13:18:04.777419Z","uid":"C6j3vyC2g0ND18JBl","id.orig_h":"217.182.199.128","id.orig_p":5132,"id.resp_h":"194.94.128.27","id.resp_p":5060,"trans_depth":0,"method":"OPTIONS","uri":"sip:100@194.94.128.27","request_from":"\"sipvicious\"<sip:100@1.1.1.1>","request_to":"\"sipvicious\"<sip:100@1.1.1.1>","call_id":"630386036184203546741250","seq":"1 OPTIONS","request_path":["SIP/2.0/UDP 217.182.199.128:5132"],"response_path":[],"user_agent":"friendly-scanner","request_body_len":0}
{"_path":"sip","_system_name":"sensor_10_0_0_2","_write_ts":"2021-02-01T13:2public","get_requests":2,"get_bulk_requests":0,"get_responses":0,"set_requests":0}

@tobim tobim merged commit 6b59b11 into master Feb 17, 2021
@tobim tobim deleted the topic/fix-json-reader-convert branch February 17, 2021 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants