{"action":"closed","issue":{"url":"https://api.github.com/repos/alipay/sofa-mosn/issues/96","repository_url":"https://api.github.com/repos/alipay/sofa-mosn","labels_url":"https://api.github.com/repos/alipay/sofa-mosn/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/alipay/sofa-mosn/issues/96/comments","events_url":"https://api.github.com/repos/alipay/sofa-mosn/issues/96/events","html_url":"https://github.com/alipay/sofa-mosn/issues/96","id":344693994,"node_id":"MDU6SXNzdWUzNDQ2OTM5OTQ=","number":96,"title":"if  upstream server is closed, downstream client send a connect will trigger panic","user":{"login":"nejisama","id":16449274,"node_id":"MDQ6VXNlcjE2NDQ5Mjc0","avatar_url":"https://avatars0.githubusercontent.com/u/16449274?v=4","gravatar_id":"","url":"https://api.github.com/users/nejisama","html_url":"https://github.com/nejisama","followers_url":"https://api.github.com/users/nejisama/followers","following_url":"https://api.github.com/users/nejisama/following{/other_user}","gists_url":"https://api.github.com/users/nejisama/gists{/gist_id}","starred_url":"https://api.github.com/users/nejisama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nejisama/subscriptions","organizations_url":"https://api.github.com/users/nejisama/orgs","repos_url":"https://api.github.com/users/nejisama/repos","events_url":"https://api.github.com/users/nejisama/events{/privacy}","received_events_url":"https://api.github.com/users/nejisama/received_events","type":"User","site_admin":false},"labels":[{"id":992423706,"node_id":"MDU6TGFiZWw5OTI0MjM3MDY=","url":"https://api.github.com/repos/alipay/sofa-mosn/labels/area/stream","name":"area/stream","color":"c2e0c6","default":false},{"id":991303034,"node_id":"MDU6TGFiZWw5OTEzMDMwMzQ=","url":"https://api.github.com/repos/alipay/sofa-mosn/labels/kind/bug","name":"kind/bug","color":"b60205","default":false},{"id":992397096,"node_id":"MDU6TGFiZWw5OTIzOTcwOTY=","url":"https://api.github.com/repos/alipay/sofa-mosn/labels/priority/P0","name":"priority/P0","color":"b60205","default":false}],"state":"closed","locked":false,"assignee":{"login":"nejisama","id":16449274,"node_id":"MDQ6VXNlcjE2NDQ5Mjc0","avatar_url":"https://avatars0.githubusercontent.com/u/16449274?v=4","gravatar_id":"","url":"https://api.github.com/users/nejisama","html_url":"https://github.com/nejisama","followers_url":"https://api.github.com/users/nejisama/followers","following_url":"https://api.github.com/users/nejisama/following{/other_user}","gists_url":"https://api.github.com/users/nejisama/gists{/gist_id}","starred_url":"https://api.github.com/users/nejisama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nejisama/subscriptions","organizations_url":"https://api.github.com/users/nejisama/orgs","repos_url":"https://api.github.com/users/nejisama/repos","events_url":"https://api.github.com/users/nejisama/events{/privacy}","received_events_url":"https://api.github.com/users/nejisama/received_events","type":"User","site_admin":false},"assignees":[{"login":"nejisama","id":16449274,"node_id":"MDQ6VXNlcjE2NDQ5Mjc0","avatar_url":"https://avatars0.githubusercontent.com/u/16449274?v=4","gravatar_id":"","url":"https://api.github.com/users/nejisama","html_url":"https://github.com/nejisama","followers_url":"https://api.github.com/users/nejisama/followers","following_url":"https://api.github.com/users/nejisama/following{/other_user}","gists_url":"https://api.github.com/users/nejisama/gists{/gist_id}","starred_url":"https://api.github.com/users/nejisama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nejisama/subscriptions","organizations_url":"https://api.github.com/users/nejisama/orgs","repos_url":"https://api.github.com/users/nejisama/repos","events_url":"https://api.github.com/users/nejisama/events{/privacy}","received_events_url":"https://api.github.com/users/nejisama/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-07-26T04:49:53Z","updated_at":"2018-07-26T10:07:02Z","closed_at":"2018-07-26T10:07:02Z","author_association":"COLLABORATOR","body":"if the upstream sever is close, client make a request, then the mesh will trigger a panic, and then auto recover.\r\n\r\ntest on protocol http2 trigger the panic, no test on xprotocol, but the code same as http2, exists the same problem.\r\nhttp will not panic, because http does not have the panic code;\r\nsofarpc will not panic, because sofarpc have nil check before use.\r\n\r\npanic code in pkg/stream/${protocol}/connpool.go: \r\nfunc NewStream() {\r\n     if p.primaryClient == nil {\r\n         p.primaryClient = newActiveClient(context, p) \r\n     }\r\n    // sofarpc recheck whether the primaryClient is nil\r\n    if !CanCreate() {\r\n    } else {\r\n      p.primaryClient.totalStream++ //primaryClient is nil  , http does not have it\r\n    } \r\n}\r\nThe newActiveClient will return nil, if the server is closed (connection refused), then use the primaryClient will trigger panic"}}
{"actor":{"display_login":"nejisama"}}