unix: handle EINTR in uv_resident_set_memory on AIX and SunOS#5034
unix: handle EINTR in uv_resident_set_memory on AIX and SunOS#5034Nandann018-ux wants to merge 2 commits intolibuv:v1.xfrom
Conversation
vtjnash
left a comment
There was a problem hiding this comment.
I don't know if procfs can return EINTR, but this looks correct for handling it anyways
|
Out of curiosity, which AI did you use to find this and make the PR? |
|
@vtjnash Thanks for taking a look! |
|
@vtjnash |
|
@japj Please review my pr and would like to change if there are any further changes. |
|
@Nandann018-ux please follow the procedure at https://github.com/libuv/libuv/blob/v1.x/CONTRIBUTING.md Nowhere does it mention that you should tag specific users. I don’t know how you “selected” the users to ping, but they are definitely not current maintainers of this project, see also https://github.com/libuv/libuv/blob/v1.x/MAINTAINERS.md (but please do not ping them instead). If you need to contact someone from the project for a discussion on how to best contribute, please use the existing community links at https://github.com/libuv/libuv/tree/v1.x?tab=readme-ov-file#community |
|
@japj |
|
@japj Can you please re-review this PR and get it merged? |
No, I cannot. I am not a maintainer of this project as you know from reading the contributor and maintainer documentation |
Summary
This PR improves the robustness of
uv_resident_set_memoryon AIX and SunOS by properly handlingEINTRfromread(2).On these platforms,
read(2)can be interrupted by a signal and return-1witherrno == EINTR. Previously, this condition was treated as a generic failure and mapped toUV_EINVALwithout retrying. As a result, legitimate interruptions could surface as misleading errors and cause spurious failures.Problem
read(2)may fail withEINTRwhen interrupted by a signal.UV_EINVAL, masking the real cause of the failure.Solution
read(2)when it fails withEINTR.Impact
Platforms Affected