Skip to content

[Tigron]: looping inside pipes reading or writing will deadlock #4231

Closed as not planned

Description

@apostasie

Description

On a command timeout, we still Wait for the ioGroup.
This works fine in normal circumstances, but if a feeder to stdin does loop forever, we just wait there.

Possible solutions:

  • separate stdin / feeders in their own group and force drop it on wrap
  • add a timeout to the ioGroup wait

Steps to reproduce the issue

Describe the results you received and expected

Timeout properly, even with a faulty feeder to would get stuck.

What version of nerdctl are you using?

main

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

Activity

  1. apostasie commented on May 9, 2025

    @apostasie
    ContributorAuthor

    The ioGroup uses a context with timeout though. That should not happen...

  2. apostasie commented on May 9, 2025

    @apostasie
    ContributorAuthor

    Meh.

    golang/go#26099

    So, errgroup with a timeout-ing context does not handle it on its own and will just wait (possibly forever)... You are supposed to terminate the group yourself when the timeout runs out.

    @AkihiroSuda did you know that (I did not)? ^

    Are there places in our codebase where we pass a context with timeout to an errgroup assuming the errgroup will self terminate once the timeout runs-out?

  3. apostasie commented on May 9, 2025

    @apostasie
    ContributorAuthor

    Closing this as wontfix.

    Unless I am mistaken, there is nothing to be done if a func in an errgroup gets in a deadloop.
    LMK if there is a solution to forcefully close a go routine.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/unconfirmed-bug-claim

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions