Skip to content

Link osdf docs#3118

Open
aowen-uwmad wants to merge 4 commits intomainfrom
link-osdf-docs
Open

Link osdf docs#3118
aowen-uwmad wants to merge 4 commits intomainfrom
link-osdf-docs

Conversation

@aowen-uwmad
Copy link
Contributor

Changes to docs/app/getting-help/troubleshooting/page.mdx are an unrelated fix.

…tering cleanup cancel

t.Cleanup callbacks run in LIFO (last-in, first-out) order. When
t.TempDir() is called after registering a t.Cleanup that calls
cancel() + egrp.Wait(), the temp dir removal runs FIRST — before
the context is cancelled. This means background goroutines launched
by LaunchXrootdMaintenance are still running and actively reading/
writing files in directories that have already been deleted.

Fix by moving t.TempDir() calls before the cancel/egrp cleanup
registration so that LIFO ordering ensures:
  1. cancel() + egrp.Wait()  — goroutine stops
  2. temp dir removal        — safe, nothing is using it
…utines

Several tests in xrootd_config_test.go called `defer ResetTestState()` alongside
a `t.Cleanup` that cancelled the context and waited on the errgroup. Because
`defer` runs before `t.Cleanup` (LIFO within their respective stacks, but all
defers execute before any t.Cleanup), `ResetTestState` would wipe the viper
configuration -- including `Cache_RunLocation` and `Origin_RunLocation` -- while the
maintenance goroutine launched by `LaunchXrootdMaintenance` was still running.

The goroutine would then read an empty RunLocation, causing EmitAuthfile to
write `authfile-cache-generated` into the working directory (i.e. the source
tree) instead of the test's temp dir.

Fix this by moving ResetTestState() into the t.Cleanup callback, after
egrp.Wait() returns, so the config is only wiped once the goroutine has
fully exited.
@aowen-uwmad
Copy link
Contributor Author

I tried rebasing to fix the "Check Rebase on Main" check that was failing, but I don't think that actually did anything..

@aowen-uwmad
Copy link
Contributor Author

I think those commits that got pulled in should probably be dropped from this PR, but I'm not sure how to do that and don't want to make things worse.

Copy link
Contributor

@brianhlin brianhlin left a comment

Choose a reason for hiding this comment

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

LGTM

@aowen-uwmad aowen-uwmad added this to the v7.25 milestone Feb 17, 2026
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.

3 participants