Skip to content

TaskContext::request_input parks forever when called after tasks/cancel #1582

Todo

Description

@orangeCatDeveloper

Describe the bug

After tasks/cancel, a task operation that calls TaskContext::request_input parks forever. TaskManager::cancel_task sets cancel_requested and clears pending_inputs, which wakes the inputs already pending. request_input does not check cancel_requested, so a call made after the cancel registers a new pending input. The task goes back to input_required and waits for an answer the client will never send, since it has cancelled the task.

This happens whenever the cancel lands between two request_input calls, or while the operation is working and has not polled ctx.cancelled() yet.

To Reproduce

On main (3725772), in task_manager.rs tests:

  1. Spawn a task whose operation awaits ctx.cancelled(), then calls ctx.request_input("after-cancel", request).
  2. manager.cancel_task(&task_id).

request_input never returns, and get_task reports input_required.

Expected behavior

request_input returns Err(TaskExit::Cancelled) once cancellation was requested, as the parked calls already do, and the task does not go back to input_required.

Additional context

Different from #1579 (an input request left outstanding when its future is dropped), though both touch request_input.

I have a fix with a test and can open a PR.

Activity

  1. github-actions commented on Dec 6, 2026

    @github-actions
    Contributor

    @connor4312 is on triage rotation this week and is the reviewer for this one.

    Automated classification did not run for this one, so it needs a full manual pass.

    Automated triage. Labels are a first pass and the assigned maintainer has the final say.

  2. orangeCatDeveloper commented on Dec 6, 2026

    @orangeCatDeveloper
    Author

    I'm working on this and have a fix with tests ready. The repo allows one open PR per contributor without write access, so I'll open it once #1583 is resolved.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions