Skip to content

Logging early in sp_init() causes hang. #79

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

Open
rountree opened this issue Apr 21, 2025 · 0 comments · May be fixed by #80
Open

Logging early in sp_init() causes hang. #79

rountree opened this issue Apr 21, 2025 · 0 comments · May be fixed by #80

Comments

@rountree
Copy link

This information log message in flux-spindle.c hangs.

debug_printf(1, "initializing spindle for use with flux");

The problem is that the log message occurs before a call to setenv() (transferring the value of SPINDLE_TEST from the flux shell to the regular shell). The log message triggers initialization of the logging system, which checks for the SPINDLE_TEST environment variable, which isn't present, thus run_tests=0. After initialization completes and the message is logged, the remaining code in sp_init() executes, which includes setting SPINDLE_TEST=1. Subsequent processes see this different value and set up the test environment, but as the first process never did, the result is a hang.

In the two runs I looked at, only the smallest pid had run_test=0, which probably means flux calls sp_init() serially.

A simple solution is to move all of the setenv() code into flux_plugin_init() along with a note to not log anything until all calls to setenv() complete.

@rountree rountree changed the title Logging before call to LOGGING_INIT in flux-spindle.c results in hang Logging early in sp_init() causes hang. Apr 21, 2025
@rountree rountree linked a pull request Apr 21, 2025 that will close this issue
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 a pull request may close this issue.

1 participant