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

Handle unexpected IP assignment failure (address already in use) #22

Merged
merged 2 commits into from
Oct 3, 2022

Conversation

sunya-ch
Copy link
Collaborator

This PR introduces a solution to handle the issue #20.

Flows:

  • When getting deallocate request, keep podName record in deallocationHistory map with start offset=1
  • When getting allocate request, if it is just deleted pod (recorded in deallocationHistory), it will be considered as anomaly behaviour. Then, it will increase offset by one when generate next available IP. According, it will return the different address compared to the previous allocate request (i.e., skip the problematic address)
  • The record is considered as expired after one minute. The deallocationHistory map will check and remove the expired record every new allocate request.

This PR also includes the test case for

  • anomaly allocate from beginning
  • anomaly allocate after some allocations
  • force make deallocationHistory expired and check Expired function

Signed-off-by: Sunyanan Choochotkaew <[email protected]>
@tatsuhirochiba tatsuhirochiba merged commit 532a284 into main Oct 3, 2022
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.

2 participants