Exceptions like client.close/subscription.close cannot be catched
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- distributed-systems
Research direction
Start by reproducing the double client.close() call from error-report.js with pulsar-client 1.14.0 on Node.js 20.18.1, then inspect the client.close and subscription.close entry points and how their failures reach the promise. Done means the close failure is catchable or repeated close calls are safely idempotent, with behavior verified for the reported example.
Written by the indexing model from the issue text.
Description
Not sure what would be better here, that either the exception should be catchable or it should be idempotent.
const Pulsar = require("pulsar-client");
const STAGING = {
serviceUrl: "pulsar+ssl://any-server:6651",
};
async function main() {
const client = new Pulsar.Client({
...STAGING,
logLevel: Pulsar.LogLevel.ERROR,
log: (level, file, line, message) => {
console.log(`[${level}] ${file}:${line}: ${message}`);
},
});
try {
await client.close();
await client.close();
} catch (error) {
console.error("omg closing client:", error);
}
}
main();
{
"dependencies": {
"pulsar-client": "^1.14.0"
}
}
Will throw
node error-report.js
node:internal/process/promises:391
triggerUncaughtException(err, true /* fromPromise */);
^
[Error: Failed to close client: AlreadyClosed]
Node.js v20.18.1
Even though I catched it
- Dominant language
- C++
- Stars
- 164
- Forks
- 99
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/pulsar-client-node
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/pulsar-client-node#477 ·
-
公司网络无法访问海外站点,如何解决? Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/pulsar-client-node#455 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/pulsar-client-node#432 · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
apache/pulsar-client-node#431 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/pulsar-client-node#427 ·
All issues in apache/pulsar-client-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Component: GLib
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
brave/brave-browser#59300 ·
-
Mute ydb/tests/functional/dstool/test_canonical_requests.py.Test.test_group_take_snapshot in main Openai_reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ydb-platform/ydb#53974 · 3 comments ·