Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Race condition onClose #12

Closed
ChrisMcKenzie opened this issue Nov 11, 2015 · 0 comments
Closed

Race condition onClose #12

ChrisMcKenzie opened this issue Nov 11, 2015 · 0 comments
Labels

Comments

@ChrisMcKenzie
Copy link
Owner

after a long download is finished exiting the agent will panic do to a send on closed channel.

panic: send on closed channel

goroutine 8 [running]:
github.com/ChrisMcKenzie/dropship/work.(*Dispatcher).start(0xc8200f8750)
        /Users/chrism/gocode/src/github.com/ChrisMcKenzie/dropship/work/dispatcher.go:59 +0x293
created by github.com/ChrisMcKenzie/dropship/work.NewDispatcher
        /Users/chrism/gocode/src/github.com/ChrisMcKenzie/dropship/work/dispatcher.go:45 +0x178

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc820104534)
        /usr/local/Cellar/go/1.5.1/libexec/src/runtime/sema.go:43 +0x26
sync.(*WaitGroup).Wait(0xc820104528)
        /usr/local/Cellar/go/1.5.1/libexec/src/sync/waitgroup.go:126 +0xb4
github.com/ChrisMcKenzie/dropship/work.(*Runner).Shutdown(0xc820104520)
        /Users/chrism/gocode/src/github.com/ChrisMcKenzie/dropship/work/runner.go:41 +0x3e
github.com/ChrisMcKenzie/dropship/commands.agent(0x7dab00, 0xc820019040, 0x0, 0x2)
        /Users/chrism/gocode/src/github.com/ChrisMcKenzie/dropship/commands/agent.go:46 +0x4c4
github.com/spf13/cobra.(*Command).execute(0x7dab00, 0xc820018f20, 0x2, 0x2, 0x0, 0x0)
        /Users/chrism/gocode/src/github.com/spf13/cobra/command.go:503 +0x869
github.com/spf13/cobra.(*Command).Execute(0x7dacc0, 0x0, 0x0)
        /Users/chrism/gocode/src/github.com/spf13/cobra/command.go:586 +0x46a
github.com/ChrisMcKenzie/dropship/commands.Execute()
        /Users/chrism/gocode/src/github.com/ChrisMcKenzie/dropship/commands/dropship.go:38 +0x28
main.main()
        /Users/chrism/Projects/dropship/main.go:6 +0x14

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:1696 +0x1

goroutine 5 [syscall]:
os/signal.loop()
        /usr/local/Cellar/go/1.5.1/libexec/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
        /usr/local/Cellar/go/1.5.1/libexec/src/os/signal/signal_unix.go:28 +0x37

goroutine 6 [select]:
github.com/ncw/swift.(*Connection).doTimeoutRequest(0xc820138120, 0xc8201e0100, 0xc82035a620, 0xc8203da120, 0x0, 0x0)
        /Users/chrism/gocode/src/github.com/ncw/swift/swift.go:226 +0x21d
github.com/ncw/swift.(*Connection).Call(0xc820138120, 0xc8201e0000, 0x3d, 0xc8200fc861, 0x6, 0xc8200197c1, 0x19, 0x55b8c0, 0x4, 0x0, ...)
        /Users/chrism/gocode/src/github.com/ncw/swift/swift.go:468 +0x6ec
github.com/ncw/swift.(*Connection).storage(0xc820138120, 0xc8200fc861, 0x6, 0xc8200197c1, 0x19, 0x55b8c0, 0x4, 0x0, 0x0, 0xc820014e10, ...)
        /Users/chrism/gocode/src/github.com/ncw/swift/swift.go:527 +0x128
github.com/ncw/swift.(*Connection).Object(0xc820138120, 0xc8200fc861, 0x6, 0xc8200197c1, 0x19, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/chrism/gocode/src/github.com/ncw/swift/swift.go:1679 +0xe2
github.com/ChrisMcKenzie/dropship/updater.(*RackspaceUpdater).IsOutdated(0xc820847cf0, 0xc8204ae340, 0x20, 0xc820847ee0, 0x1, 0x0, 0x0)
        /Users/chrism/gocode/src/github.com/ChrisMcKenzie/dropship/updater/rackspace.go:42 +0xb2
github.com/ChrisMcKenzie/dropship/work.(*Dispatcher).Work(0xc8200f8750)
        /Users/chrism/gocode/src/github.com/ChrisMcKenzie/dropship/work/dispatcher.go:74 +0x418
github.com/ChrisMcKenzie/dropship/work.NewRunner.func1(0xc820104520)
        /Users/chrism/gocode/src/github.com/ChrisMcKenzie/dropship/work/runner.go:26 +0x7e
created by github.com/ChrisMcKenzie/dropship/work.NewRunner
        /Users/chrism/gocode/src/github.com/ChrisMcKenzie/dropship/work/runner.go:29 +0xe4

goroutine 9 [select, locked to thread]:
runtime.gopark(0x63e798, 0xc82002ff28, 0x561f88, 0x6, 0x2cc18, 0x2)
        /usr/local/Cellar/go/1.5.1/libexec/src/runtime/proc.go:185 +0x163
runtime.selectgoImpl(0xc82002ff28, 0x0, 0x18)
        /usr/local/Cellar/go/1.5.1/libexec/src/runtime/select.go:392 +0xa64
runtime.selectgo(0xc82002ff28)
        /usr/local/Cellar/go/1.5.1/libexec/src/runtime/select.go:212 +0x12
runtime.ensureSigM.func1()
        /usr/local/Cellar/go/1.5.1/libexec/src/runtime/signal1_unix.go:227 +0x323
runtime.goexit()
        /usr/local/Cellar/go/1.5.1/libexec/src/runtime/asm_amd64.s:1696 +0x1

goroutine 25 [select]:
net/http.(*persistConn).writeLoop(0xc8204b40b0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:686 +0xc9d

goroutine 24 [IO wait]:
net.runtime_pollWait(0x2101098, 0x72, 0xc8200122e0)
        /usr/local/Cellar/go/1.5.1/libexec/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8204c2140, 0x72, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8204c2140, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8204c20e0, 0xc820536000, 0x8000, 0x8000, 0x0, 0xfa0050, 0xc8200122e0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc82013c040, 0xc820536000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc820487260, 0x21011a8, 0xc82013c040, 0x5, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc8204d6000, 0x63e817, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc8204d6000, 0xc8204f8000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x210df88, 0xc8204d6000, 0xc8204b4108, 0xc8204f8000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8204f01a0, 0xc8204f8000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc82049cba0)
        /usr/local/Cellar/go/1.5.1/libexec/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc82049cba0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc8204b40b0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:685 +0xc78

goroutine 4046 [select]:
net/http.(*persistConn).writeLoop(0xc8204b4370)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:686 +0xc9d

goroutine 4045 [select]:
net/http.(*persistConn).readLoop(0xc8204b4370)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:976 +0xac7
created by net/http.(*Transport).dialConn
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:685 +0xc78

goroutine 4027 [select]:
net/http.(*persistConn).writeLoop(0xc820413970)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:686 +0xc9d

goroutine 4026 [IO wait]:
net.runtime_pollWait(0x2100f18, 0x72, 0xc8200122e0)
        /usr/local/Cellar/go/1.5.1/libexec/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82001a3e0, 0x72, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82001a3e0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82001a380, 0xc8202be800, 0x400, 0x400, 0x0, 0xfa0050, 0xc8200122e0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820030038, 0xc8202be800, 0x400, 0x400, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/net.go:172 +0xe4
crypto/tls.(*block).readFromUntil(0xc8203e22d0, 0x21011a8, 0xc820030038, 0x5, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(*Conn).readRecord(0xc8204d6580, 0x63e817, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(*Conn).Read(0xc8204d6580, 0xc820261000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/crypto/tls/conn.go:901 +0x167
net/http.noteEOFReader.Read(0x210df88, 0xc8204d6580, 0xc8204139c8, 0xc820261000, 0x1000, 0x1000, 0xc820222840, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:1370 +0x67
net/http.(*noteEOFReader).Read(0xc8203beee0, 0xc820261000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        <autogenerated>:126 +0xd0
bufio.(*Reader).fill(0xc82047d7a0)
        /usr/local/Cellar/go/1.5.1/libexec/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).Peek(0xc82047d7a0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/bufio/bufio.go:132 +0xcc
net/http.(*persistConn).readLoop(0xc820413970)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:876 +0xf7
created by net/http.(*Transport).dialConn
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:685 +0xc78

goroutine 4023 [select]:
net/http.(*persistConn).roundTrip(0xc820413970, 0xc82046a0a0, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:1164 +0xb0d
net/http.(*Transport).RoundTrip(0xc8201bad80, 0xc82035a620, 0xb8, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/transport.go:235 +0x530
net/http.send(0xc82035a620, 0xfa44b0, 0xc8201bad80, 0xc82047c660, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/client.go:220 +0x52c
net/http.(*Client).send(0xc82043ad20, 0xc82035a620, 0x5e, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/client.go:143 +0x15a
net/http.(*Client).doFollowingRedirects(0xc82043ad20, 0xc82035a620, 0x63e390, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/client.go:380 +0xbc0
net/http.(*Client).Do(0xc82043ad20, 0xc82035a620, 0x2246b1, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/net/http/client.go:175 +0x9c
github.com/ncw/swift.(*Connection).doTimeoutRequest.func1(0xc820138120, 0xc82035a620, 0xc82047c480)
        /Users/chrism/gocode/src/github.com/ncw/swift/swift.go:222 +0x36
created by github.com/ncw/swift.(*Connection).doTimeoutRequest
        /Users/chrism/gocode/src/github.com/ncw/swift/swift.go:224 +0x8b
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant