Skip to content

Conversation

@rynewang
Copy link
Contributor

@rynewang rynewang commented Nov 13, 2023

These classes carry system resources (FDs) and are not meant to be copied (and dup'd) so to avoid accidental copy we delete the copy constructors.

also removed a dynamic_pointer_cast since it's an upcast so static suffices.

@rynewang rynewang changed the title [core] make ProcessFD non copyable. [core] make ProcessFD, [Client,Server]Connection non copyable. Nov 14, 2023
@rynewang rynewang marked this pull request as ready for review November 14, 2023 00:28
return *this;
}

intptr_t ProcessFD::CloneFD() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

it is not used now btw? (I assume yes given deleting copy constructor just succeeds?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's not used anywhere

}

void ProcessFD::CloseFD() { fd_ = -1; }
fd_ = -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm interseting... this seems actually never used (existing closeFd)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed

@rkooo567 rkooo567 merged commit 8209893 into ray-project:master Nov 17, 2023
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Nov 29, 2023
…roject#41106)

These classes carry system resources (FDs) and are not meant to be copied (and dup'd) so to avoid accidental copy we delete the copy constructors.

also removed a dynamic_pointer_cast since it's an upcast so static suffices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants