Skip to content

fix: timeoutSignal is lost after being overriden with controller.signal - #2665

Merged
k8s-ci-robot merged 5 commits into
kubernetes-client:mainfrom
sachiniyer:siyer/fix-timeout-signal-watch
Oct 28, 2025
Merged

k8s-ci-robot merged 5 commits into
kubernetes-client:mainfrom
sachiniyer:siyer/fix-timeout-signal-watch

Conversation

@sachiniyer

Copy link
Copy Markdown
Contributor

I believe that the watch timeout abort signal was getting overwritten, and I think 0ae5ddf just forgot to delete line 44.

I wrote a one-off test to make sure this was really happening, but please let me know if I should be adding a unit test for this functionality as part of this PR.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 17, 2025
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 17, 2025
@cjihrig

cjihrig commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

I wrote a one-off test to make sure this was really happening, but please let me know if I should be adding a unit test for this functionality as part of this PR.

That would be very helpful!

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 17, 2025
@sachiniyer
sachiniyer marked this pull request as draft October 17, 2025 17:35
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 17, 2025
@sachiniyer

Copy link
Copy Markdown
Contributor Author

Hi @cjihrig !

I've added a previously failing test. If you add back the line that I deleted, you will see that the test hangs/times out.

I also made the timeout value a private instance property to make it more easily testable - hopefully that's alright.

@sachiniyer
sachiniyer marked this pull request as ready for review October 17, 2025 17:45
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 17, 2025

@cjihrig cjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM, thanks.

Comment thread src/watch_test.ts Resolved
Comment thread src/watch_test.ts Resolved
@sachiniyer
sachiniyer requested a review from cjihrig October 18, 2025 00:56
@sachiniyer

Copy link
Copy Markdown
Contributor Author

Made both adjustments @cjihrig

Lmk if anything else looks off.

@cjihrig

cjihrig commented Oct 18, 2025

Copy link
Copy Markdown
Contributor

The code looks good to me, but in CI it's crashing the Node.js process in C code somehow (impressive):

node: ../deps/uv/src/unix/stream.c:446: uv__stream_destroy: Assertion `!uv__io_active(&stream->io_watcher, POLLIN | POLLOUT)' failed.
✖ /home/runner/work/javascript/javascript/dist/watch_test.js (1764.106097ms)

@sachiniyer

sachiniyer commented Oct 20, 2025 •

Copy link
Copy Markdown
Contributor Author

Hey @cjihrig , I have no idea why this is happening (or how to debug it really).

I bumped the timeout to 10 ms for the test, and the actions are passing on a test pr that I created on my fork of this repo - sachiniyer#1

If there is a way to be doing better due diligence for this change, please lmk.

@cjihrig

cjihrig commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Before merging, do @brendandburns or @mstruebing have any concerns given #2665 (comment)

@mstruebing

mstruebing commented Oct 22, 2025 •

Copy link
Copy Markdown
Member

I would run the pipeline a couple of times - I just restarted it a couple of times and it seems stable.
That's probably some bug in NodeJS itself, so I'm fine with merging when it runs kinda stable

@sachiniyer

sachiniyer commented Oct 28, 2025 •

Copy link
Copy Markdown
Contributor Author

Hey @cjihrig and @mstruebing, thanks for reviewing this PR.

Please lmk if there is anything I can do from my side to move this along. If we are worried about the test failing, I can attempt to write it even cleaner (or maybe remove the test and just merge the fix?)

@cjihrig cjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 28, 2025
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cjihrig, sachiniyer

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 28, 2025
@k8s-ci-robot
k8s-ci-robot merged commit e6922f8 into kubernetes-client:main Oct 28, 2025
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants