Skip to content

Conversation

Keno
Copy link
Member

@Keno Keno commented Jul 31, 2025

This is an alternative to #59161, attempting to fix the same observed CI behavior. I don't think #59161 is the best way to fix it, as the point of these tests is to make sure that REPL completions looks up the PATH internally. Calling the path update function explicitly defeats that somewhat. The extra synchronization here to make this deterministic is messy, but I do think it makes the test closer to real-world usage.

The core attempted fix here is to move the read of the PATH_ locals inside maybe_spawn_cache_PATH into the locked region. If they are not under the lock, they could be unconditionally overwritten by a second call to this function, causing issues in the state machine. I do not know whether this is the cause of the observed CI hangs, but it's worth fixing anyway.

This is an alternative to #59161, attempting to fix the same observed
CI behavior. I don't think #59161 is the best way to fix it, as the
point of these tests is to make sure that REPL completions looks
up the PATH internally. Calling the path update function explicitly
defeats that somewhat. The extra synchronization here to make this
deterministic is messy, but I do think it makes the test closer to
real-world usage.

The core attempted fix here is to move the read of the PATH_ locals
inside `maybe_spawn_cache_PATH` into the locked region. If they
are not under the lock, they could be unconditionally overwritten
by a second call to this function, causing issues in the state machine.
I do not know whether this is the cause of the observed CI hangs, but
it's worth fixing anyway.
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

SGTM

@Keno Keno merged commit 9a16119 into master Jul 31, 2025
8 checks passed
@Keno Keno deleted the kf/59161alternative branch July 31, 2025 16:11
@mbauman mbauman added test This change adds or pertains to unit tests completions Tab and autocompletion in the repl labels Jul 31, 2025
@KristofferC KristofferC added the backport 1.12 Change should be backported to release-1.12 label Sep 5, 2025
KristofferC pushed a commit that referenced this pull request Sep 5, 2025
This is an alternative to #59161, attempting to fix the same observed CI
behavior. I don't think #59161 is the best way to fix it, as the point
of these tests is to make sure that REPL completions looks up the PATH
internally. Calling the path update function explicitly defeats that
somewhat. The extra synchronization here to make this deterministic is
messy, but I do think it makes the test closer to real-world usage.

The core attempted fix here is to move the read of the PATH_ locals
inside `maybe_spawn_cache_PATH` into the locked region. If they are not
under the lock, they could be unconditionally overwritten by a second
call to this function, causing issues in the state machine. I do not
know whether this is the cause of the observed CI hangs, but it's worth
fixing anyway.

(cherry picked from commit 9a16119)
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Sep 11, 2025
KristofferC pushed a commit that referenced this pull request Sep 15, 2025
This is an alternative to #59161, attempting to fix the same observed CI
behavior. I don't think #59161 is the best way to fix it, as the point
of these tests is to make sure that REPL completions looks up the PATH
internally. Calling the path update function explicitly defeats that
somewhat. The extra synchronization here to make this deterministic is
messy, but I do think it makes the test closer to real-world usage.

The core attempted fix here is to move the read of the PATH_ locals
inside `maybe_spawn_cache_PATH` into the locked region. If they are not
under the lock, they could be unconditionally overwritten by a second
call to this function, causing issues in the state machine. I do not
know whether this is the cause of the observed CI hangs, but it's worth
fixing anyway.

(cherry picked from commit 9a16119)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completions Tab and autocompletion in the repl test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants