Skip to content

[CloudWatch] Logging worker cancellation spam with ExistingWorkPolicy.REPLACE #3179

@NicolasBrandi

Description

@NicolasBrandi

Before opening, please confirm:

Language and Async Model

Kotlin

Amplify Categories

Not applicable

Gradle script dependencies

Details
// Put output below this line

Environment information

Details
# Put output below this line


Please include any relevant guides or documentation you're referencing

No response

Describe the feature request

I am seeing frequent WorkManager cancellation warnings from the CloudWatch logging plugin. The stack shows cancellations of CloudwatchRouterWorker/CloudwatchLogsSyncWorker caused by CancelWorkRunnable.forNameInline, which aligns with enqueueSync() using ExistingWorkPolicy.REPLACE.

Example log of the cancelation:

Work [ id=..., tags={ CloudwatchRouterWorker, CloudwatchLogsSyncWorker } ] was cancelled
WorkerStoppedException
… CancelWorkRunnable.forNameInline …

Is there a recommended way to avoid the cancellation spam? Would you consider using a different policy (e.g., KEEP or self‑rescheduling) or suppressing cancellation warnings?

Initialization steps (if applicable)

No response

Code Snippet

// Put your code below this line.

Configuration File

No response

GraphQL Schema

Details
// Put your schema below this line

Additional information and screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    loggingRelated to the Logging category/pluginsquestionGeneral question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions