Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

get error when run a period of time: goroutine 115 [select, 3 minutes], goroutine 116 [IO wait] etc. #35

Open
huahuayu opened this issue Jun 29, 2021 · 1 comment

Comments

@huahuayu
Copy link

my code:

	pool := tunny.NewFunc(runtime.NumCPU(), func(i interface{}) interface{} {
		updateDB(i.(string))
		return nil
	})
	for scanner.Scan() {
		line := scanner.Text()
		go pool.Process(line)
	}
}

func updateDB(line string) {
        // updateDB logic
}

get error when run a period of time:

goroutine 115 [select, 3 minutes]:
github.com/ethereum/go-ethereum/rpc.(*Client).dispatch(0xc0005a0180, 0xe1d4b8, 0xc000506270)
        /home/amber/go/pkg/mod/github.com/ethereum/go-ethereum@v1.10.4/rpc/client.go:561 +0x27d
created by github.com/ethereum/go-ethereum/rpc.initClient
        /home/amber/go/pkg/mod/github.com/ethereum/go-ethereum@v1.10.4/rpc/client.go:223 +0x2c5

goroutine 116 [IO wait]:
internal/poll.runtime_pollWait(0x7fbf244dc6b0, 0x72, 0xffffffffffffffff)
        /usr/local/go/src/runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc0005a0118, 0x72, 0x400, 0x400, 0xffffffffffffffff)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0005a0100, 0xc000346000, 0x400, 0x400, 0x0, 0x0, 0x0)
        /usr/local/go/src/internal/poll/fd_unix.go:166 +0x1d5
net.(*netFD).Read(0xc0005a0100, 0xc000346000, 0x400, 0x400, 0x8b, 0x100010000, 0xc000264230)
        /usr/local/go/src/net/fd_posix.go:55 +0x4f
net.(*conn).Read(0xc000266010, 0xc000346000, 0x400, 0x400, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/net.go:183 +0x91
bufio.(*Reader).fill(0xc0001c0b40)
        /usr/local/go/src/bufio/bufio.go:101 +0x108
bufio.(*Reader).Peek(0xc0001c0b40, 0x2, 0x0, 0x0, 0x20, 0x0, 0x0)
        /usr/local/go/src/bufio/bufio.go:139 +0x4f
github.com/gorilla/websocket.(*Conn).read(0xc000194160, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/amber/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:370 +0x46
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc000194160, 0x9, 0x0, 0x0)
        /home/amber/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:798 +0x5c
github.com/gorilla/websocket.(*Conn).NextReader(0xc000194160, 0xc000102480, 0x7fbef01c8da8, 0x8, 0x18, 0x7fbf4d7cc108)
        /home/amber/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/conn.go:980 +0x8f
github.com/gorilla/websocket.(*Conn).ReadJSON(0xc000194160, 0xc0bb20, 0xc003f37728, 0x1, 0xc003f37728)
        /home/amber/go/pkg/mod/github.com/gorilla/websocket@v1.4.2/json.go:50 +0x2f
github.com/ethereum/go-ethereum/rpc.(*jsonCodec).readBatch(0xc0000c80a0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/amber/go/pkg/mod/github.com/ethereum/go-ethereum@v1.10.4/rpc/json.go:209 +0x57
github.com/ethereum/go-ethereum/rpc.(*Client).read(0xc0005a0180, 0xe1d4b8, 0xc000506270)
        /home/amber/go/pkg/mod/github.com/ethereum/go-ethereum@v1.10.4/rpc/client.go:634 +0xca
created by github.com/ethereum/go-ethereum/rpc.(*Client).dispatch
        /home/amber/go/pkg/mod/github.com/ethereum/go-ethereum@v1.10.4/rpc/client.go:558 +0x10f
goroutine 163 [select, 3 minutes]:
github.com/Jeffail/tunny.(*workerWrapper).run(0xc0000d5d40)
        /home/amber/go/pkg/mod/github.com/!jeffail/tunny@v0.1.4/worker.go:93 +0x1d4
created by github.com/Jeffail/tunny.newWorkerWrapper
        /home/amber/go/pkg/mod/github.com/!jeffail/tunny@v0.1.4/worker.go:70 +0x130
goroutine 146519 [select, 3 minutes]:
github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1(0xc012709e60, 0xc00036a5a0, 0xc0001d2300)
        /home/amber/go/pkg/mod/github.com/go-sql-driver/mysql@v1.5.0/connection.go:621 +0xa5
created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher
        /home/amber/go/pkg/mod/github.com/go-sql-driver/mysql@v1.5.0/connection.go:618 +0xbe
@mihaitodor
Copy link
Contributor

@huahuayu I looked into this a bit and it's not clear what the issue is. Are you getting a panic or some deadlock?

If possible, it would help a lot to get a self-contained code sample that I can run to debug the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants