node.js closing a client, is it possible?

200 views
Skip to first unread message

Francesco Lazzarino

unread,
Feb 14, 2017, 10:54:49 PM2/14/17
to grpc.io
In node.js how do you close a client? There doesn't seem to be a method on a Client for that.

I tried to close the underlying Channel (on macOS), but the result is that the server's connection seems to be left in CloseWait, and the client leaves a connection stuck in FinWait2.

This scenario seems like it might consume OS and network infrastructure resources unnecessarily.

Can someone add some clarity to the situation?

Thanks in advance,

– Franco

Michael Lumish

unread,
Feb 15, 2017, 11:56:04 AM2/15/17
to Francesco Lazzarino, grpc.io
It's a little awkward, but you can close a client with grpc.closeClient(client). That just closes the channel, though, so if that didn't work, that's a bug. I don't recognize the names "CloseWait" and "FinWait2", can you be more specific about how this is failing?

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/70194916-b14e-415e-8609-50e88ff138d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Francesco Lazzarino

unread,
Feb 15, 2017, 9:34:55 PM2/15/17
to grpc.io, flazz...@gmail.com
Michael,

I haven't tried grpc.closeClient(client) yet, but I did try client.$channel.close(), which seems to be the same.

To the best of my knowledge CloseWait/FinWait2 means that the client and server have started termination of the TCP session, but not finalized it. The impact is that network gear might keep those connections around for some timeout period. If the rate of creating closewait connections exceeds the timeout resources start to diminish.

nmcc...@gmail.com

unread,
Jul 17, 2018, 8:58:15 PM7/17/18
to grpc.io
Did anyone ever figure this out? I am seeing the exact same issue on 1.11.3

Michael Lumish

unread,
Jul 23, 2018, 5:39:39 PM7/23/18
to nmcc...@gmail.com, grpc.io
Can you be more specific? What issue exactly are you seeing?

Also, to add to the previous information I gave, there is now a Client.prototype.close method in addition to the previously mentioned functions.

On Tue, Jul 17, 2018 at 5:58 PM <nmcc...@gmail.com> wrote:
Did anyone ever figure this out? I am seeing the exact same issue on 1.11.3

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
Reply all
Reply to author
Forward
0 new messages