Skip to content

[lldb] Added an exponential algorithm for the sleep time in connect_to_debug_monitor() #118222

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

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def setUpServerLogging(self, is_llgs):
]

def get_next_port(self):
return 12000 + random.randint(0, 3999)
return 12000 + random.randint(0, 7999)

def reset_test_sequence(self):
self.test_sequence = GdbRemoteTestSequence(self.logger)
Expand Down Expand Up @@ -388,7 +388,8 @@ def connect_to_debug_monitor(self, attach_pid=None):
# We're using a random port algorithm to try not to collide with other ports,
# and retry a max # times.
attempts = 0
MAX_ATTEMPTS = 20
MAX_ATTEMPTS = 10
attempt_wait = 3

while attempts < MAX_ATTEMPTS:
server = self.launch_debug_monitor(attach_pid=attach_pid)
Expand Down Expand Up @@ -424,7 +425,8 @@ def connect_to_debug_monitor(self, attach_pid=None):

# And wait a random length of time before next attempt, to avoid
# collisions.
time.sleep(random.randint(1, 5))
time.sleep(attempt_wait)
attempt_wait *= 1.2

# Now grab a new port number.
self.port = self.get_next_port()
Expand Down
Loading