From 8c48fd183eb7786fc39f54a2daba3e53a536c7d0 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Fri, 2 Oct 2015 16:35:24 -0700 Subject: [PATCH 1/3] Change to the default redis port and use docker port mapping --- command/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/init.go b/command/init.go index 63e495913b4..0b9be934b06 100644 --- a/command/init.go +++ b/command/init.go @@ -122,7 +122,7 @@ job "example" { memory = 256 # 256MB network { mbits = 10 - dynamic_ports = ["redis"] + dynamic_ports = ["6379"] } } } From 02fb48fbc19f456849427561f4e442603524564d Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Sun, 4 Oct 2015 13:36:03 -0700 Subject: [PATCH 2/3] Cleanup allocations when in dev mode --- client/alloc_runner.go | 8 ++++++++ client/client.go | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/client/alloc_runner.go b/client/alloc_runner.go index a366ee18351..f4613ad67cd 100644 --- a/client/alloc_runner.go +++ b/client/alloc_runner.go @@ -53,6 +53,7 @@ type AllocRunner struct { destroy bool destroyCh chan struct{} destroyLock sync.Mutex + waitCh chan struct{} } // allocRunnerState is used to snapshot the state of the alloc runner @@ -74,6 +75,7 @@ func NewAllocRunner(logger *log.Logger, config *config.Config, updater AllocStat taskStatus: make(map[string]taskStatus), updateCh: make(chan *structs.Allocation, 8), destroyCh: make(chan struct{}), + waitCh: make(chan struct{}), } return ar } @@ -258,6 +260,7 @@ func (r *AllocRunner) setTaskStatus(taskName, status, desc string) { // Run is a long running goroutine used to manage an allocation func (r *AllocRunner) Run() { + defer close(r.waitCh) go r.dirtySyncState() // Check if the allocation is in a terminal status @@ -376,3 +379,8 @@ func (r *AllocRunner) Destroy() { r.destroy = true close(r.destroyCh) } + +// WaitCh returns a channel to wait for termination +func (r *AllocRunner) WaitCh() <-chan struct{} { + return r.waitCh +} diff --git a/client/client.go b/client/client.go index 148cee4c7ac..744bad87691 100644 --- a/client/client.go +++ b/client/client.go @@ -184,6 +184,15 @@ func (c *Client) Shutdown() error { if c.shutdown { return nil } + + // Destroy all the running allocations. + if c.config.DevMode { + for _, ar := range c.allocs { + ar.Destroy() + <-ar.WaitCh() + } + } + c.shutdown = true close(c.shutdownCh) c.connPool.Shutdown() From 022b6fb6c5a74d8b02bc3fa0f8b84168f9ceb3ed Mon Sep 17 00:00:00 2001 From: Kevin Fishner Date: Mon, 5 Oct 2015 22:23:09 -0400 Subject: [PATCH 3/3] Update _footer.erb --- website/source/layouts/_footer.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/source/layouts/_footer.erb b/website/source/layouts/_footer.erb index dc66cf8c8bf..1c965cdfaf4 100644 --- a/website/source/layouts/_footer.erb +++ b/website/source/layouts/_footer.erb @@ -26,7 +26,7 @@ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - ga('create', 'UA-62364009-1', 'auto'); + ga('create', 'UA-68490725-1', 'auto'); ga('send', 'pageview');