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

executor调用cni插件时没有进行错误判断,导致cni调用失败时触发executor异常[bug] #88

Closed
abstractmj opened this issue Jul 11, 2019 · 0 comments
Assignees
Labels
bug Something isn't working confirmed issue is confirmed inner issue comes from Tencent side

Comments

@abstractmj
Copy link
Collaborator

问题描述

bk-bcs/bcs-mesos/bcs-container-executor/network/cni/cni.go
代码没有进行错误处理,导致cni插件如果返回error,executor会出现空指针错误,虽然executor有对runtime error的recover,但是会造成list taskgroup时显示bcs-executor is down,造成误解
func (plugin *CNIPlugin) addNetworkV2(runConf *libcni.RuntimeConf) (*current.Result, error) {
var err error
var r cnitypes.Result
if plugin.isCniList {
r, err = plugin.cniNet.AddNetworkList(plugin.netConfList, runConf)

} else {
	r, err = plugin.cniNet.AddNetwork(plugin.netConf, runConf)
}

重现方法

  • 调用cni插件返回错误时,可以耗尽IP地址,也可以将cni的conf文件修改成错的

./bcs-container-executor --version 输出的内容:
Version :1.13.2-alpha-19.07.02
Tag :1.13.2-alpha
BuildTime: 2019-07-02T15:23:25+0800
GitHash: 9097082

2019/07/11 17:33:48 BcsExecutor init pod success.
2019/07/11 17:33:48 CNI plugin manager ADD pod c9e885877b25db3f35885b9dbcf4ad0927f2976d9fad0ae3a18bb84b6f717029 network with bcs-qcloud
2019/07/11 17:33:48 CNI plugin bcs-qcloud set conf {"ContainerID":"c9e885877b25db3f35885b9dbcf4ad0927f2976d9fad0ae3a18bb84b6f717029","NetNS":"/proc/15264/ns/net","IfName":"eth1","Args":[["IgnoreUnknown","true"]],"CapabilityArgs":null}
2019/07/11 17:33:48 Lauch panic: runtime error: invalid memory address or nil pointer dereference
2019/07/11 17:33:48 CNIPod prepare to stop 0 running containers
2019/07/11 17:33:48 CNIPod stop 0 running containers done
2019/07/11 17:33:48 Task 1562837627857764032.0.2.test.test.10000 Update Status TASK_FAILED, Message: bcs executor down

@abstractmj abstractmj added the bug Something isn't working label Jul 11, 2019
@DeveloperJim DeveloperJim added confirmed issue is confirmed inner issue comes from Tencent side labels Jul 11, 2019
@DeveloperJim DeveloperJim added this to the 1.14.x功能迭代 milestone Jul 11, 2019
DeveloperJim added a commit that referenced this issue Jul 12, 2019
fix: fix bug that bcs-executor get runtime error; issue #88
DeveloperJim added a commit that referenced this issue Nov 4, 2019
fix: fix bug that bcs-executor get runtime error; issue #88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed issue is confirmed inner issue comes from Tencent side
Projects
None yet
Development

No branches or pull requests

2 participants