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

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

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

Thanks in advance,

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 @
postedMar 14, '15 at 4:24a
activeMar 14, '15 at 3:48p

2 users in discussion

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



site design / logo © 2021 Grokbase