FAQ
Is there any way to interrupt a Read on a net.Conn, without closing the
connection?

My use case is hot deployment / upgrade of an instant messaging server. The
old process stops reading on all the TCP sockets, we start the new process,
send it the socket FDs over a unix domain socket, the new process starts
reading, the old process exits. Between the time the old process stops
reading and the new process starts, the kernel queues incoming messages
because the connections remain open, so the deploy is transparent to the
users.

Currently I do this by having a short timeout on the Read, but regularly
waking up thousands of mostly idle connections isn't ideal.

AFAIK what I'm asking isn't available, but is in theory possible. The Read
is not blocked on a syscall, on Linux at least it's using epoll. I think
what I want is a way of asking the net poller to stop polling this socket,
basically epoll_ctl EPOLL_CTL_DEL. Or is there a different way to approach
this?

Thanks in advance,
Graham

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 14, '15 at 4:24a
activeMar 14, '15 at 3:48p
posts3
users2
websitegolang.org

2 users in discussion

Graham4king: 2 posts Tamás Gulácsi: 1 post

People

Translate

site design / logo © 2021 Grokbase