Skip to content

Conversation

@divyenpatel
Copy link
Member

@divyenpatel divyenpatel commented Dec 19, 2025

What this PR does / why we need it:
When Upsert is called with a new TaskDetails for an existing task (e.g., due to retry logic), the old channel was orphaned. The caller blocked on waitForResultOrTimeout would never receive a response.

Changes:

  • Modified Upsert to return (TaskDetails, bool) so caller can detect when a task was replaced and send an error to the old channel
  • AddTask now sends error to old channel when replacing a task to unblock waiters
  • Added thread-safe locking to Count() method
  • Added comprehensive unit tests for TaskMap and listview functions

The race condition between processTaskUpdate and reportErrorOnAllPendingTasks is handled correctly by existing non-blocking sends with buffer size 1.

Testing done:
Executed unit tests.
Pre-checkin

Special notes for your reviewer:

Release note:

Fix listview task channel handling when task is replaced

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyenpatel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 19, 2025
@deepakkinni
Copy link
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #786

@divyenpatel divyenpatel force-pushed the address-listview-fixes-feedback branch from 4596a86 to fe167ac Compare December 19, 2025 22:01
@deepakkinni
Copy link
Collaborator

FAILED --- Jenkins Build #786

@divyenpatel divyenpatel force-pushed the address-listview-fixes-feedback branch from fe167ac to 76b3b68 Compare December 22, 2025 21:47
When Upsert is called with a new TaskDetails for an existing task
(e.g., due to retry logic), the old channel was orphaned. The caller
blocked on waitForResultOrTimeout would never receive a response.

Changes:
- Modified Upsert to return (TaskDetails, bool) so caller can detect
  when a task was replaced and send an error to the old channel
- AddTask now sends error to old channel when replacing a task to
  unblock waiters
- Added thread-safe locking to Count() method
- Added comprehensive unit tests for TaskMap and listview functions

The race condition between processTaskUpdate and reportErrorOnAllPendingTasks
is handled correctly by existing non-blocking sends with buffer size 1.
@divyenpatel divyenpatel force-pushed the address-listview-fixes-feedback branch from 76b3b68 to 059fb57 Compare January 5, 2026 21:29
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2026
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@divyenpatel divyenpatel closed this Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants