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: continue reading ipc on data error #605

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Conversation

mattsse
Copy link
Member

@mattsse mattsse commented Apr 23, 2024

the json stream deserializer has issues with partial objects.

this continues the stream on data errors as long as the internal buffer does not exceed the configured capacity

@prestwich prestwich merged commit 234ff5e into main Apr 23, 2024
18 checks passed
@prestwich prestwich deleted the matt/decode-partial-objects branch April 23, 2024 11:30
// trigger pending read
.wait(std::time::Duration::from_millis(1))
// complete object
.read(vec![b"a"[0]; CAPACITY].as_ref())
Copy link
Member

Choose a reason for hiding this comment

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

b'a' 🐱

@prestwich prestwich mentioned this pull request Apr 23, 2024
@publicqi
Copy link
Contributor

Is there a reason for setting CAPACITY 4096? Lots of RPC response can exceed this.

@mattsse
Copy link
Member Author

mattsse commented Jun 22, 2024

this is the initial, pre allocated capacity

@publicqi
Copy link
Contributor

publicqi commented Jun 22, 2024

Yeah but a partial response will hit

if this.buf.len() > CAPACITY {
    // buffer is full, we can't decode any more
    error!("IPC response too large to decode");
    return Ready(None);
}

@mattsse
Copy link
Member Author

mattsse commented Jun 22, 2024

oh right, this is wrong of course -.-

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.

4 participants