apache / apache/pulsar-client-node

No Error handling for Deserialize method which ends up crashing Node JS

Open
#422 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
164
Forks
98
PR merge metrics
No merged PRs in 30d

Description

Hello Team

Here I am trying to serialize and deserialize messageId for my business use case

but issue is for proper error handling if in case we pass invalid buffer data to MessageId.deserialize method then it throws C++ exception
`libc++abi: terminating due to uncaught exception of type std::invalid_argument: Failed to parse serialized message id`
which is not handled by pulsar-client and node JS crashes

I see similar issue was there while creating a client too but that got fixed with this issue and PR https://github.com/apache/pulsar-client-node/pull/307/files
where it was wrapped with try catch block
but deserialize method is still not fixed

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at MessageId.deserialize and compare its error handling with the client handling introduced in PR #307. Reproduce the invalid-buffer case and trace the deserialize binding; done means invalid input no longer terminates Node.js with an uncaught C++ exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript, node.js
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.