Skip to content

Conversation

@tamilmani1989
Copy link
Member

@tamilmani1989 tamilmani1989 commented Mar 8, 2022

Reason for Change:

Windows CNI to ignore removenamespaceendpoint error. sometimes cri removes namespace before cni get to removenamespaceendpoint api and thus its failing with namespace not found error and hns endpoint and ip is getting leaked. this change will ignore error from that api and proceed with hns endpoint deletion and ip release

Issue Fixed:

Requirements:

Notes:

@tamilmani1989 tamilmani1989 requested a review from aegal March 8, 2022 22:36
return fmt.Errorf("Failed to remove hcn endpoint: %s from namespace: %s due to error: %v", ep.HnsId,
log.Errorf("Failed to remove hcn endpoint: %s from namespace: %s due to error: %v", ep.HnsId,
hcnEndpoint.HostComputeNamespace, err)
}
Copy link
Contributor

@aegal aegal Mar 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we should be able to getNameSpace to check if it exists before calling this method. But not sure if HNS has a getNameSpace API to see if its created.

If not, can we parse the error to see if it contains a "namespace not found" error instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we discussed offline, even if this api return other errors, cni should still go ahead and delete hns endpoint and release ip from ipam

@zhiweiv
Copy link
Contributor

zhiweiv commented Mar 9, 2022

Will this fix #831? The error is
Failed to remove hcn endpoint: 6fa6d738-c90b-49df-8dff-c87f92278f16 from namespace: b0b21776-a2e8-4439-a82e-8442f482fa46 due to error: hcnOpenNamespace failed in Win32: Element not found. (0x490) {"Success":false,"Error":"Element not found. ","ErrorCode":2147943568}.

We got "No available addresses" more frequently in recent.

@tamilmani1989
Copy link
Member Author

tamilmani1989 commented Mar 9, 2022

Will this fix #831? The error is Failed to remove hcn endpoint: 6fa6d738-c90b-49df-8dff-c87f92278f16 from namespace: b0b21776-a2e8-4439-a82e-8442f482fa46 due to error: hcnOpenNamespace failed in Win32: Element not found. (0x490) {"Success":false,"Error":"Element not found. ","ErrorCode":2147943568}.

We got "No available addresses" more frequently in recent.

yep this PR will fix it

@tamilmani1989
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tamilmani1989 tamilmani1989 enabled auto-merge (squash) March 9, 2022 21:26
@aegal
Copy link
Contributor

aegal commented Mar 9, 2022

lgtm

@tamilmani1989 tamilmani1989 disabled auto-merge March 9, 2022 22:57
@tamilmani1989 tamilmani1989 merged commit 6ec4203 into master Mar 10, 2022
@tamilmani1989 tamilmani1989 deleted the tamanoha/wincniDeleteFix branch March 10, 2022 17:58
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

Successfully merging this pull request may close these issues.

4 participants