{"action":"created","issue":{"url":"https://api.github.com/repos/nhooyr/TunneLS/issues/3","repository_url":"https://api.github.com/repos/nhooyr/TunneLS","labels_url":"https://api.github.com/repos/nhooyr/TunneLS/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/nhooyr/TunneLS/issues/3/comments","events_url":"https://api.github.com/repos/nhooyr/TunneLS/issues/3/events","html_url":"https://github.com/nhooyr/TunneLS/issues/3","id":182376423,"number":3,"title":"WaitGroup reuse issue","user":{"login":"jacobhaven","id":95305,"avatar_url":"https://avatars.githubusercontent.com/u/95305?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobhaven","html_url":"https://github.com/jacobhaven","followers_url":"https://api.github.com/users/jacobhaven/followers","following_url":"https://api.github.com/users/jacobhaven/following{/other_user}","gists_url":"https://api.github.com/users/jacobhaven/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobhaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobhaven/subscriptions","organizations_url":"https://api.github.com/users/jacobhaven/orgs","repos_url":"https://api.github.com/users/jacobhaven/repos","events_url":"https://api.github.com/users/jacobhaven/events{/privacy}","received_events_url":"https://api.github.com/users/jacobhaven/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-11T21:15:23Z","updated_at":"2016-10-11T21:33:35Z","closed_at":"2016-10-11T21:25:02Z","body":"While running some performance testing, I came across this panic.\r\n\r\n```\r\npanic: sync: WaitGroup is reused before previous Wait has returned\r\n\r\ngoroutine 629 [running]:\r\npanic(0x1ab480, 0xc4203043d0)\r\n\t/usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:500 +0x1a1\r\nsync.(*WaitGroup).Wait(0xc42000a5d8)\r\n\t/usr/local/Cellar/go/1.7.1/libexec/src/sync/waitgroup.go:133 +0xfe\r\nmain.(*node).tunnel(0xc42000a500, 0x2ba820, 0xc42002c240, 0x2ba760, 0xc4203cb180)\r\n\t/Users/jhaven/gopath/src/github.com/nhooyr/TunneLS/node.go:328 +0x3b5\r\nmain.(*node).dialAndTunnel(0xc42000a500, 0x2ba820, 0xc42002c240)\r\n\t/Users/jhaven/gopath/src/github.com/nhooyr/TunneLS/node.go:319 +0x202\r\ncreated by main.(*node).listenAndServeErr\r\n\t/Users/jhaven/gopath/src/github.com/nhooyr/TunneLS/node.go:295 +0x318\r\npanic: sync: WaitGroup is reused before previous Wait has returned\r\n\r\ngoroutine 627 [running]:\r\npanic(0x1ab480, 0xc420a72220)\r\n\t/usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:500 +0x1a1\r\nsync.(*WaitGroup).Wait(0xc42000a5d8)\r\n\t/usr/local/Cellar/go/1.7.1/libexec/src/sync/waitgroup.go:133 +0xfe\r\nmain.(*node).tunnel(0xc42000a500, 0x2ba820, 0xc42002c230, 0x2ba760, 0xc4203cbc00)\r\n\t/Users/jhaven/gopath/src/github.com/nhooyr/TunneLS/node.go:328 +0x3b5\r\nmain.(*node).dialAndTunnel(0xc42000a500, 0x2ba820, 0xc42002c230)\r\n\t/Users/jhaven/gopath/src/github.com/nhooyr/TunneLS/node.go:319 +0x202\r\ncreated by main.(*node).listenAndServeErr\r\n\t/Users/jhaven/gopath/src/github.com/nhooyr/TunneLS/node.go:295 +0x318\r\n```\r\n\r\nIt appears that by using a single `WaitGroup` for all `tunnel`/`copy` calls on a `node`, we're running into a race condition when multiple tunnels are being created simultaneously (e.g. in high traffic or testing environments).\r\n"},"comment":{"url":"https://api.github.com/repos/nhooyr/TunneLS/issues/comments/253053452","html_url":"https://github.com/nhooyr/TunneLS/issues/3#issuecomment-253053452","issue_url":"https://api.github.com/repos/nhooyr/TunneLS/issues/3","id":253053452,"user":{"login":"nhooyr","id":10180857,"avatar_url":"https://avatars.githubusercontent.com/u/10180857?v=3","gravatar_id":"","url":"https://api.github.com/users/nhooyr","html_url":"https://github.com/nhooyr","followers_url":"https://api.github.com/users/nhooyr/followers","following_url":"https://api.github.com/users/nhooyr/following{/other_user}","gists_url":"https://api.github.com/users/nhooyr/gists{/gist_id}","starred_url":"https://api.github.com/users/nhooyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhooyr/subscriptions","organizations_url":"https://api.github.com/users/nhooyr/orgs","repos_url":"https://api.github.com/users/nhooyr/repos","events_url":"https://api.github.com/users/nhooyr/events{/privacy}","received_events_url":"https://api.github.com/users/nhooyr/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T21:33:35Z","updated_at":"2016-10-11T21:33:35Z","body":"1. Code is much more simple and easy to maintain. Likely more performant too. \r\n2. tlsmuxd has automated certificates via lets encrypt\r\n3. tlsmuxd also lets you multiplex based on SNI and hostnames\r\n4. tlswrapd supports ALPN\r\n\r\nIt does depend on your needs though because tlsmuxd only supports ACME and lets encrypt for certificates. You cannot use your own. tlsmuxd and tlswrapd both also do not support client authentication.\r\n\r\nIf you really need those features, they aren't very hard to implement in tlsmuxd/tlswrapd. I just haven't gotten around to it yet.\r\n\r\nAlso, I have a much stronger interest in maintaining them and as such, I would be more willing to respond to feature requests and what not. This repository is basically dead for me in terms of actual development."}}
{"actor":{"display_login":"nhooyr"}}