Skip to content

Accept an AbortSignal in resource-client methods #1071

Closed

Description

@vdusek

This is a follow-up to #1058 (comment).

ApifyRequestConfig.signal (src/http_clients/base.ts:140) lets a caller abort httpClient.call(): the attempt in flight ends, no retry follows and the call rejects with the signal's reason. No resource-client method forwards one, so client.actor('x').get() and run.waitForFinish() cannot be aborted from a shutdown handler. They end only through their per-attempt timeout, and the polling methods default to timeoutSecs: 'noTimeout'.

Nearly every public method already takes an options object that extends TimeoutOptions (src/timeouts.ts:38), and the polling ones take ActorCallOptions, TaskCallOptions, RunWaitForFinishOptions and BuildClientWaitForFinishOptions. A signal field on those types, forwarded into the ApifyRequestConfig built in src/base/resource_client.ts and src/base/resource_collection_client.ts, covers them.

Acceptance criteria

  • ActorClient.call(), TaskClient.call(), RunClient.waitForFinish() and BuildClient.waitForFinish() stop polling once the signal aborts and reject with its reason.
  • Single-request methods whose options extend TimeoutOptions forward the signal to the request.
  • The zod schemas of those options accept the field, so parseArgument() does not reject it.

✍️ Drafted by Claude Code

Activity

  1. added
    enhancementNew feature or request.
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Sep 18, 2026
  2. self-assigned this
    on Sep 18, 2026
  3. added this to the 3.0 milestone on Sep 18, 2026
  4. added a commit that references this issue on Sep 29, 2026
    5285245
  5. vdusek commented on Sep 29, 2026

    @vdusek
    ContributorAuthor

    resolved by #1081

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request.t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions