Skip to content

Use the active user when cleaning the NGINX environment - #5817

Open
GlazerMann wants to merge 4 commits into
OSC:masterfrom
GlazerMann:patch-8
Open

GlazerMann wants to merge 4 commits into
OSC:masterfrom
GlazerMann:patch-8

Conversation

@GlazerMann

@GlazerMann GlazerMann commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Fix nginx_clean so NGINX environment cleanup is performed for the user currently being processed.

NginxCleanGenerator iterates over the active users as u, but the cleanup call currently uses the generator's outer user option:

NginxStage.clean_nginx_env(user: user)

The following NGINX stop operation correctly uses the loop variable:

NginxStage.nginx_args(user: u, signal: :stop)

That means the environment being cleaned and the PUN being stopped can refer to different users. When nginx_clean is invoked without restricting cleanup to a single user, user can also be nil, so the cleanup is not scoped to the active user being processed.

Change the cleanup call to:

NginxStage.clean_nginx_env(user: u)

so all operations in that iteration consistently target the same user.

Relationship to other open PRs

#5809 currently contains the same incorrect clean_nginx_env(user: user) call in its modified NginxCleanGenerator lifecycle-lock path. #5817 should therefore be merged before #5809 and #5809 rebased onto it, or the equivalent correction must be made in #5809 before merge.

This is especially relevant to #5809 because that PR deliberately serializes PUN cleanup per user with:

with_pun_lifecycle_lock(user: u)

Using the outer user value for environment cleanup inside that lock would undermine the per-user consistency that #5809 is intended to provide.

For the current related PR sequence, this fits naturally as:

#5816  FilesTest asynchronous cleanup race
#5815  accessibility MutationObserver race
#5817  nginx_clean per-user environment cleanup
#5813  BatchConnect detached-node race
#5809  PUN lifecycle serialization

After #5817 lands, #5809 should be rebased so its nginx_clean path inherits this correction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Awaiting Review

Development

Successfully merging this pull request may close these issues.

2 participants