Skip to content

Conversation

@ldoktor
Copy link
Contributor

@ldoktor ldoktor commented May 7, 2025

Not intended for merging, debugging #147

ldoktor added 4 commits April 30, 2025 11:06
In case aexpect_helper kill fails we end-up waiting for infinity (eg.
when in system call or unschedulable state). Let's change this to
up-to-60s wait and then proceeding with warning, which might result in
left-behind aexpect_helper but should proceed with other testing.

Signed-off-by: Lukáš Doktor <[email protected]>
The POSIX lockf doesn't protect other threads accessing the lock while
BSD lock does. Let's switch to BSD locks to protect against multiple
threads accessing the same sections.

Signed-off-by: Lukáš Doktor <[email protected]>
The Spawn.close() contains critical section that should not be accessed
multiple times, which might happen when a user uses aexpect from
different threads/processes. Let's add a lock to protect it.

Signed-off-by: Lukáš Doktor <[email protected]>
Signed-off-by: Lukáš Doktor <[email protected]>
@ldoktor ldoktor marked this pull request as draft May 7, 2025 10:50
@ldoktor ldoktor mentioned this pull request May 7, 2025
lock = None
try:
try:
lock = get_lock_fd(self._close_lockfile, timeout=60)

Check warning

Code scanning / CodeQL

File is not always closed Warning

File is opened but is not closed.
:return: True on success, False on failure/timeout
"""
try:
lock_fd = get_lock_fd(filename, timeout)

Check warning

Code scanning / CodeQL

File is not always closed Warning

File is opened but is not closed.
ldoktor added 2 commits May 12, 2025 12:29
Signed-off-by: Lukáš Doktor <[email protected]>
to avoid problems with NTP (or iffy clock sources) let's use
time.monotonic() for time difference operations.

Signed-off-by: Lukáš Doktor <[email protected]>
@ldoktor ldoktor closed this May 21, 2025
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.

1 participant