Threadsafe configuration changes

42 views
Skip to first unread message

Kevin Granger

unread,
Sep 21, 2015, 10:13:34 PM9/21/15
to goproxy-dev
I'm working on making configuration changes for all Handlers threadsafe, so it can be done while the proxy is still running.

Is this something that I should contribute back, or is this too much complexity for a specific use case?

Elazar Leibovich

unread,
Sep 22, 2015, 12:09:01 AM9/22/15
to Kevin Granger, goproxy-dev
This sounds like a good idea if it won't have too many negative effects in general.

But can we discuss the design first?

Is there anyone else interested?

Thanks,
Elazar

On Tue, Sep 22, 2015 at 5:13 AM, Kevin Granger <kime...@gmail.com> wrote:
I'm working on making configuration changes for all Handlers threadsafe, so it can be done while the proxy is still running.

Is this something that I should contribute back, or is this too much complexity for a specific use case?

--
You received this message because you are subscribed to the Google Groups "goproxy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to goproxy-dev...@googlegroups.com.
To post to this group, send email to gopro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/goproxy-dev/3cd7db1f-1673-4905-9f1d-0e0731be26f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Granger

unread,
Sep 22, 2015, 8:25:48 AM9/22/15
to goproxy-dev, kime...@gmail.com
Right now I replaced the slices of *Conditions in the proxy with sync/atomic.Values, so there's an extra step for retrieval and storage. But this way reads don't block during writes so currently processing requests or repsonses won't be held up.

There's also a mutex for writing, otherwise a write that gets the current list before the older write finishes would destroy whatever the first one did (writes are racy for atomic.Values).

I'd also like to consider adding the ability to inspect or at least clear all current *Conditions.

Karolis Rusenas

unread,
Nov 5, 2015, 9:01:31 AM11/5/15
to goproxy-dev, kime...@gmail.com
I would also be interested in configuration changes while running. 
Reply all
Reply to author
Forward
0 new messages