Failed to close writer connection
See original GitHub issueHi
I’m running nsqd by docker with latest tag and use this library to write message to the nsqd, below is a part of my source code:
...skip
publish(topic, message) {
const nsqWriter = new nsq.Writer(
this.nsqHost,
this.nsqPort,
);
return new Promise((resolve, reject) => {
nsqWriter.connect();
nsqWriter.once('error', err => reject(err));
nsqWriter.once('ready', () => {
nsqWriter.publish(topic, message, (err) => {
if (err) reject(err);
nsqWriter.close();
});
nsqWriter.once('closed', () => resolve());
});
});
}
If I use the latest version of this lib (v0.9.2), nsqWriter.close();
will lead to Error: E_INVALID cannot CLS in current state (nsqd logging the same error too when I open -verbose flag), however when I downgrade version to v0.8.4 then everything is working fine.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Getting error while trying to close text writer - Stack Overflow
Getting error while trying to close text writer ; import java.io.FileNotFoundException; import ; MedConcept { public ; (String[] args) { ...
Read more >Closing AMQP connection frequently with errors {writer ...
> I see too many {writer,send_failed,{error,timeout}} in rabbitmq logs. This means socket writes fail due to timeout (from the RabbitMQ end).
Read more >"WRT_8376 : Writer encounters a connection failure ... - ERROR
In PowerCenter, random sessions fail intermittently with the following error in multiple session logs: Database driver error.
Read more >Error: listener: closing connection: unable to write reply of length
I just installed the New Relic agent on a server to test and I am getting this error: Error: listener: closing connection: unable...
Read more >Oracle JDBC connection cannot be closed properly
Because my program failed to close the connection, it put this connection into a list so that a background thread was able to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dudleycarr please let me know when you fix this. I’ll be more than happy to test the changes.
Looks like it’s only appropriate to use the
CLS
protocol command when using aReader
. See here: https://github.com/nsqio/nsq/blob/c164c776ab1af72706fff6cc05cd80a36771811d/nsqd/protocol_v2.go#L753I’ll make a change to remove sending
CLS
forWriter
.