Skip to content

[core] Implement dup2 wrapper #50439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Feb 28, 2025
Merged

Conversation

dentiny
Copy link
Contributor

@dentiny dentiny commented Feb 11, 2025

It's used in logging redirection to achieve

  • cross-platform
  • RAII-style dup2

@dentiny dentiny added the go add ONLY when ready to merge, run all tests label Feb 11, 2025
@dentiny dentiny requested review from jjyao and edoakes February 11, 2025 20:39
Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny dentiny force-pushed the hjiang/dup2-with-restore branch from 2fa5410 to 75db43a Compare February 11, 2025 20:51
Signed-off-by: hjiang <hjiang@anyscale.com>
Comment on lines 333 to 334
"@platforms//os:windows": ["dup2_wrapper_windows.cc"],
"//conditions:default": ["dup2_wrapper_posix.cc"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the difference between this approach and the other approach the current codebase is using which is ifdef

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No difference,

  • select clause works at file level, ifdef works at source code level
  • I use select here because implementation for two platforms are completely different and almost nothing to share

Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny dentiny requested a review from jjyao February 12, 2025 06:04
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny dentiny requested a review from jjyao February 12, 2025 06:51
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny
Copy link
Contributor Author

dentiny commented Feb 13, 2025

@jjyao The failed CI test has nothing to do with my change, which hasn't been integrated with python yet.

Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny
Copy link
Contributor Author

dentiny commented Feb 16, 2025

@jjyao This PR should be good to go, the only change related to windows platform is C++ side unit tests, which already passed. I don't know why my CI gets stuck for a day.

@dentiny
Copy link
Contributor Author

dentiny commented Feb 17, 2025

Hi @jjyao I think this PR should be good to go.

Copy link
Collaborator

@jjyao jjyao left a comment

Choose a reason for hiding this comment

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

LG

Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny dentiny requested a review from jjyao February 28, 2025 01:49
Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny
Copy link
Contributor Author

dentiny commented Feb 28, 2025

The failed fake_cgroup_setup_test has nothing to do with my change

@jjyao jjyao enabled auto-merge (squash) February 28, 2025 16:59
@jjyao jjyao merged commit 544125c into ray-project:master Feb 28, 2025
5 of 6 checks passed
VamshikShetty pushed a commit to VamshikShetty/ray that referenced this pull request Mar 3, 2025
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: vs030455 <vamshikdshetty@gmail.com>
Michaelhess17 pushed a commit to Michaelhess17/ray that referenced this pull request Mar 3, 2025
Signed-off-by: dentiny <dentinyhao@gmail.com>
xsuler pushed a commit to antgroup/ant-ray that referenced this pull request Mar 4, 2025
Signed-off-by: dentiny <dentinyhao@gmail.com>
park12sj pushed a commit to park12sj/ray that referenced this pull request Mar 18, 2025
Signed-off-by: dentiny <dentinyhao@gmail.com>
jaychia pushed a commit to jaychia/ray that referenced this pull request Mar 19, 2025
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: Jay Chia <17691182+jaychia@users.noreply.github.com>
jaychia pushed a commit to jaychia/ray that referenced this pull request Mar 19, 2025
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: Jay Chia <17691182+jaychia@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-backlog go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants