Lvnszn opened a new pull request #1719: URL: https://github.com/apache/dubbo-go/pull/1719
<!-- Thanks for sending a pull request! Read https://github.com/apache/dubbo-go/blob/master/CONTRIBUTING.md before commit pull request. --> **What this PR does**: 现在有两种 Panic 的问题被修复了,主要是因为连接中断导致 Connection 这个对象被清理了,然后有其他协程内会执行 Connection 这个对象就会出现 Panic 的问题。 - 当连接中断的时候,Getty 会收到一个 EOF Error,接着 defer 会执行 gc() 函数,他会把 Connection 设置为 nil。但是有很多个 Task 被放到了 Pool 里面,等待 Pool 调度到 Task 的时候,他会开启协程去执行 Task。这时候 Connection 已经被设置为空了,那么用到 Connection 的函数就会出现 panic 的问题。 - 在 Dubbo go 中会执行 GetActive 这个函数,GetActive 也是操作 Connection 内的函数,但是其实那时候可能因为上层的超时或者解析失败已经连接中断,那么 Connection 已经被清除了,所以就出现了 Panic 的问题。 **Which issue(s) this PR fixes**: Fixes #1650 **You should pay attention to items below to ensure your pr passes our ci test** We do not merge pr with ci tests failed - [ ] All ut passed (run 'go test ./...' in project root) - [ ] After go-fmt ed , run 'go fmt project' using goland. - [ ] Golangci-lint passed, run 'sudo golangci-lint run' in project root. - [ ] After import formatted, (using [imports-formatter](https://github.com/dubbogo/tools#5-how-to-get-imports-formatter) to run 'imports-formatter .' in project root, to format your import blocks, mentioned in [CONTRIBUTING.md](https://github.com/apache/dubbo-go/blob/master/CONTRIBUTING.md) above) - [ ] Your new-created file needs to have [apache license](https://raw.githubusercontent.com/dubbogo/resources/master/tools/license/license.txt) at the top, like other existed file does. - [ ] All integration test passed. You can run integration test locally (with docker env). Clone our [dubbo-go-samples](https://github.com/apache/dubbo-go-samples) project and replace the go.mod to your dubbo-go, and run 'sudo sh start_integration_test.sh' at root of samples project root. (M1 Slice is not Support) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
