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

Tasks are executed sequentially if user waits to confirm prompt #3364

Open
moritz-makandra opened this issue Nov 27, 2024 · 0 comments
Open
Labels
Bug Bug reports and fixes.

Comments

@moritz-makandra
Copy link

Describe the Bug

I have a plan that first gathers data, shows the data to the user and then promt whether to to continue to run_task_with .

If the user confirms the promt immediately (<2min) the tasks called by run_task_with run in parallel as expected.

If the user waits longer than 2 minutes to confirm the dialog, the subsequent tasks run sequentially.

This is the structure of the plan in Question

plan example (
  String $groups = 'staging,production'
) {

  split($groups,/,/).each |TargetSpec $group| {
    $gather_information = run_task('fetch_data')
    $processed_information = process_data($gather_information)
    out::message($processed_information)
    if prompt("Proceed on group ${group}>?> [y/N]", 'default' => 'N') =~ /^[Yy]/) {
      $result = run_task_with('execute', keys($processed_information), _noop => $noop, '_catch_errors' => true) |$target| {
        {
          'defaults' = 'yes',
        }
      }
    }
  }
}

Expected Behavior

Run tasks in parallel, even if the user waits for some time to confirm the prompt

Steps to Reproduce

Steps to reproduce the behavior:

  1. Run the plan above
  2. Wait for 3 minutes before answer the promt with y
  3. run ss -atp | grep :ssh | grep ESTAB | grep bolt to see the number of ssh sessions

Environment

  • Version 3.30.0

  • Ubuntu 22.04

Additional Context

  • target group size 30 - 200

bolt-project.yaml

concurrency: 20
plugin-cache:
  ttl: 1800

debug log

When the bug occurs only one Worker is logging like number 19 in this example.

On good runs there is more than one runner executing the tasks.

2024-11-27T11:25:39.658054 INFO   [exec-worker-19] [Bolt::Executor] Running task execute' on ["target.host.example.local"]
2024-11-27T11:25:39.658169 DEBUG  [exec-worker-19] [Bolt::Transport::SSH] Running task 'execute' on target.host.example.local with '{redacted}'
2024-11-27T11:25:43.817602 INFO   [exec-worker-19] [Bolt::Executor] {"target":"target.host.example.local","action":"task","object":"execute","status":"success","value":{redacted}}
2024-11-27T11:25:43.818384 INFO   [exec-worker-19] [Bolt::Executor] Running task execute' on ["another_target.host.example.local"]
2024-11-27T11:25:43.819116 DEBUG  [exec-worker-19] [Bolt::Transport::SSH] Running task 'execute' on another_target.host.example.local with '{redacted}'
@moritz-makandra moritz-makandra added the Bug Bug reports and fixes. label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug reports and fixes.
Projects
None yet
Development

No branches or pull requests

1 participant