Hi Masahiro,

It seems the C++ client causes the AlreadyClosed issue.
https://github.com/apache/pulsar-client-cpp/issues/51

I think this issue doesn't block releasing new Node.js client.
What do you think?

Thanks,
--
Yuri Mizushima
yumiz...@yahoo-corp.jp


"Masahiro Sakamoto" <massa...@yahoo-corp.jp> wrote:

-1 (binding)

I almost always get "Failed to send message: AlreadyClosed" errors when running 
the following code:
##############################
$ cat producer.js
const Pulsar = require('./index.js');

(async () => {
  const client = new Pulsar.Client({
    serviceUrl: 'pulsar://localhost:6650',
  });

  const producer = await client.createProducer({
    topic: 'persistent://public/default/t1',
    batchingEnabled: false,
  });

  for (let i = 0; i < 10; i += 1) {
    const msg = `my-message-${i}`;
    producer.send({
      data: Buffer.from(msg),
    });
    console.log(`Sent message: ${msg}`);
  }
  await producer.flush();

  await producer.close();
  await client.close();
})();
$ node producer.js
Sent message: my-message-0
Sent message: my-message-1
Sent message: my-message-2
Sent message: my-message-3
Sent message: my-message-4
Sent message: my-message-5
Sent message: my-message-6
Sent message: my-message-7
Sent message: my-message-8
Sent message: my-message-9
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(Use `node --trace-warnings ...` to show where the warning was created)
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045043149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=d31GWwFv0GBd3ggHyez5T5YWTPq0SFxW%2B6YqTSOnyDw%3D&amp;reserved=0).
 (rejection id: 1)
(node:18572) [DEP0018] DeprecationWarning: Unhandled promise rejections are 
deprecated. In the future, promise rejections that are not handled will 
terminate the Node.js process with a non-zero exit code.
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045043149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=d31GWwFv0GBd3ggHyez5T5YWTPq0SFxW%2B6YqTSOnyDw%3D&amp;reserved=0).
 (rejection id: 2)
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045043149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=d31GWwFv0GBd3ggHyez5T5YWTPq0SFxW%2B6YqTSOnyDw%3D&amp;reserved=0).
 (rejection id: 3)
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045043149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=d31GWwFv0GBd3ggHyez5T5YWTPq0SFxW%2B6YqTSOnyDw%3D&amp;reserved=0).
 (rejection id: 4)
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045043149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=d31GWwFv0GBd3ggHyez5T5YWTPq0SFxW%2B6YqTSOnyDw%3D&amp;reserved=0).
 (rejection id: 5)
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045043149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=d31GWwFv0GBd3ggHyez5T5YWTPq0SFxW%2B6YqTSOnyDw%3D&amp;reserved=0).
 (rejection id: 6)
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045043149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=d31GWwFv0GBd3ggHyez5T5YWTPq0SFxW%2B6YqTSOnyDw%3D&amp;reserved=0).
 (rejection id: 7)
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045043149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=d31GWwFv0GBd3ggHyez5T5YWTPq0SFxW%2B6YqTSOnyDw%3D&amp;reserved=0).
 (rejection id: 8)
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045043149%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=d31GWwFv0GBd3ggHyez5T5YWTPq0SFxW%2B6YqTSOnyDw%3D&amp;reserved=0).
 (rejection id: 9)
(node:18572) UnhandledPromiseRejectionWarning: Error: Failed to send message: 
AlreadyClosed
(node:18572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). To 
terminate the node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see 
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnodejs.org%2Fapi%2Fcli.html%23cli_unhandled_rejections_mode&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045199389%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=mlq9J72IRWe76fDhPDIjsiy%2B%2F64tDI%2FmZUXLRKtoziU%3D&amp;reserved=0).
 (rejection id: 10)
##############################
I think it would be better to investigate the cause of this before release.
Thanks,

Masahiro Sakamoto
Yahoo Japan Corp.
E-mail: massa...@yahoo-corp.jp

-----Original Message-----
From: Hiroyuki Sakai <hsa...@yahoo-corp.jp>
Sent: Friday, October 7, 2022 9:28 AM
To: dev@pulsar.apache.org
Subject: Re: [VOTE] Pulsar Node.js Client Release 1.7.0 Candidate 2

+1 (binding)

* check the license headers
* build the source and run producer/consumer
* verify checksum and signatures

==========
Hiroyuki Sakai
Yahoo Japan Corp.
E-mail: hsa...@yahoo-corp.jp

________________________________
From: Yuto Furuta <yfur...@yahoo-corp.jp>
Sent: Thursday, October 6, 2022 15:57
To: dev@pulsar.apache.org <dev@pulsar.apache.org>
Subject: [VOTE] Pulsar Node.js Client Release 1.7.0 Candidate 2

Hi everyone,
Please review and vote on the release candidate #2 for the version 1.7.0, as 
follows:
[ ] +1, Approve the release
[ ] -1, Do not approve the release (please provide specific comments)

This is the second release candidate for Apache Pulsar Node.js client, version 
1.7.0.

It fixes the following issues:
https://github.com/apache/pulsar-client-node/issues?q=label%3Arelease%2Fv1.7.0+is%3Aclosed

Please download the source files and review this release candidate:
- Review release notes
- Download the source package (verify shasum and asc) and follow the README.md 
to build and run the Pulsar Node.js client.

The vote will be open for at least 72 hours. It is adopted by majority 
approval, with at least 3 PMC affirmative votes.

Source files:
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdist.apache.org%2Frepos%2Fdist%2Fdev%2Fpulsar%2Fpulsar-client-node%2Fpulsar-client-node-1.7.0-candidate-2%2F&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045199389%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=G7kZBEugtzMu%2FFAXFVlU0SzDmhbOXzvt9YWhAemDZTE%3D&amp;reserved=0

Pulsar's KEYS file containing PGP keys we use to sign the release:
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdist.apache.org%2Frepos%2Fdist%2Fdev%2Fpulsar%2FKEYS&amp;data=05%7C01%7Cyumizush%40yahoo-corp.jp%7Cad44a31ff988434d3f1f08daa82142b0%7Ca208d369cd4e4f87b11998eaf31df2c3%7C1%7C0%7C638007158045199389%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=mdbkDWgLqcL5VMyFQxRzA%2FHUiHh6P%2BylYBP9pyzuAQ4%3D&amp;reserved=0

SHA-512 checksum:
7012560ef62744d5211d858e3784276a694f83437bb929c2fcec9f249706d7bea0d9b757f464298a25725b702340c760a2c9ff488814c6c11d8a10362b2ffe0a
  pulsar-client-node-1.7.0.tar.gz

The tag to be voted upon:
v1.7.0-rc.2
https://github.com/apache/pulsar-client-node/releases/tag/v1.7.0-rc.2

Reply via email to