Skip to content
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

When --help flag is passed to a test the program hangs/never exits #2635

Closed
nvartolomei opened this issue Feb 4, 2025 · 0 comments
Closed
Assignees

Comments

@nvartolomei
Copy link
Contributor

This PR breaks --help when it is passed to a test #2213

I.e.

 → tests/unit/rpc_test -- --help
Running 35 test cases...
App options:
  -h [ --help ]                         show help message
  --help-seastar                        show help message about seastar options
  --help-loggers                        print a list of logger names and exit
  --random-seed arg                     Random number generator seed
  --fail-on-abandoned-failed-futures arg (=1)
                                        Fail the test if there are any
                                        abandoned failed futures

^C^C^C^C^C^C

The app just hangs instead of exiting.

My guess is that the problem is somewhere around this code block

init_outcome->give(0);

tchaikov added a commit to tchaikov/seastar that referenced this issue Feb 17, 2025
Previously, when handling "--help" (introduced in b8a13be), we returned
status code 0 but continued scheduling test tasks to the Seastar reactor.
This caused test applications to hang since the tasks expected the exchanger
'e' to be available after reactor exit.

Fix this by using the "_done" flag to track reactor state:
- Set "_done" when Seastar application exits
- Skip task scheduling and exchanger wait if "_done" is set
- Reuse existing "_done" member as it's safe in single-threaded context

This fixes the regression where "--help" would cause test applications to
hang indefinitely.

Fixes scylladb#2635
Signed-off-by: Kefu Chai <[email protected]>
@tchaikov tchaikov self-assigned this Feb 17, 2025
tchaikov added a commit to tchaikov/seastar that referenced this issue Feb 17, 2025
Previously, when handling "--help" (introduced in b8a13be), we returned
status code 0 but continued scheduling test tasks to the Seastar reactor.
This caused test applications to hang since the tasks expected the exchanger
'e' to be available after reactor exit.

Fix this by using the "_done" flag to track reactor state:
- Set "_done" when Seastar application exits
- Skip task scheduling and exchanger wait if "_done" is set
- Change test_runner::start_thread() to return bool indicating successful
  engine startup instead of exit code (exit code now stored in _exit_code
  member)

This fixes the regression where "--help" would cause test applications to
hang indefinitely.

Fixes scylladb#2635
Signed-off-by: Kefu Chai <[email protected]>
tchaikov added a commit to tchaikov/seastar that referenced this issue Feb 18, 2025
Previously, when handling "--help" (introduced in b8a13be), we returned
status code 0 but continued scheduling test tasks to the Seastar reactor.
This caused test applications to hang since the tasks expected the exchanger
'e' to be available after reactor exit.

Fix this by using the "_done" flag to track reactor state:
- Set "_done" when Seastar application exits
- Skip task scheduling and exchanger wait if "_done" is set
- Change test_runner::start_thread() to return bool indicating successful
  engine startup instead of exit code (exit code now stored in _exit_code
  member)

This fixes the regression where "--help" would cause test applications to
hang indefinitely.

Fixes scylladb#2635
Signed-off-by: Kefu Chai <[email protected]>
@xemul xemul closed this as completed in 9ca4fee Feb 19, 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 a pull request may close this issue.

2 participants