Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ip_count_list increments even if port creation is not successfull
Description: when address allocation fails, bit is not freed.

Change-Id: Id4f3ff8b7261232039d77a1d3e0b9d0fe38459d7
Closes-Bug: #1772156
  • Loading branch information
Suresh-vin committed May 31, 2018
1 parent ec4e891 commit 4479d3b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/config/common/zkclient.py
Expand Up @@ -264,15 +264,11 @@ def alloc(self, value=None, pools=None):
else:
idx = self._in_use.index(0)
self._in_use[idx] = 1

try:
idx = self._get_zk_index_from_bit(idx)
except ResourceExhaustionError as e:
if self._in_use.all():
self._in_use.pop(1)
else:
self._in_use[idx] = 0
raise ResourceExhaustionError(str(e))
self._in_use[idx] = 0
raise

try:
# Create a node at path and return its integer value
Expand Down

0 comments on commit 4479d3b

Please sign in to comment.