Skip to content
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

msg/async: reset fd to -1 after closing it #21296

Closed
wants to merge 3 commits into from

Conversation

shangfufei
Copy link

@shangfufei shangfufei commented Apr 9, 2018

After listen_socket was closed, it entered the start() process magically. so I think we should make '_fd = -1' when listen_socket was closed. And in the start process, determine the value of listen_socket, if it equal to -1, return the process.
Fixes: https://tracker.ceph.com/issues/23600
Signed-off-by: shangfufei shangfufei@inspur.com

@shangfufei shangfufei force-pushed the wip-async-bugfix-23600 branch 2 times, most recently from 77855e1 to cc41395 Compare April 9, 2018 09:18
@tchaikov tchaikov requested a review from yuyuyu101 April 9, 2018 10:17
@tchaikov
Copy link
Contributor

tchaikov commented Apr 9, 2018

@shangfufei please summarize the change in the title of your commit message, see https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#title-of-pull-requests-and-title-of-commits, and use the notation of "Fixes: " in the commit message, see https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#tag-the-commit

@yuyuyu101
Copy link
Member

when listen_socket abort, the socket will be reset. what happen if server_socket exists and fd==-1?

@shangfufei
Copy link
Author

this time will run the Processor::stop function,just delete listen socket fd from epoll event.

@shangfufei shangfufei changed the title msg/async: bug fix 23600. msg/async: Fixes: https://tracker.ceph.com/issues/23600. Apr 9, 2018
@shangfufei shangfufei changed the title msg/async: Fixes: https://tracker.ceph.com/issues/23600. msg/async: Fixes: https://tracker.ceph.com/issues/23600. Apr 9, 2018
@shangfufei shangfufei force-pushed the wip-async-bugfix-23600 branch 7 times, most recently from af49a40 to 8d57552 Compare April 10, 2018 13:21
…the start() process magically. so I think we should make '_fd = -1' when listen_socket was closed. And in the start process, determine the value of listen_socket, if it equal to -1, return the process

Fixes: https://tracker.ceph.com/issues/23600

Signed-off-by: shangfufei <shangfufei@inspur.com>
@tchaikov tchaikov changed the title msg/async: Fixes: https://tracker.ceph.com/issues/23600. msg/async: reset fd to -1 after closing it Apr 16, 2018
@tchaikov
Copy link
Contributor

@shangfufei again, please summarize the change in the title of your commit message. and please remove "bug fix 23600" from the title.

@liewegas
Copy link
Member

I'm definitely on board with setting fd to -1 on close; not doing so can lead to all kinds of problems with data written to the wrong socket or file (!!!), and writing to -1 at least will error out instead of causing more damage.

@stale
Copy link

stale bot commented Oct 18, 2018

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you are a maintainer or core committer, please follow-up on this issue to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@stale stale bot added the stale label Oct 18, 2018
@tchaikov
Copy link
Contributor

@shangfufei please note the commit message and title of the PR are different. also please rebase. modulo these nits, lgtm.

@stale stale bot removed the stale label Oct 18, 2018
@shangfufei
Copy link
Author

get it, i'm doing now,

@tchaikov
Copy link
Contributor

@shangfufei please remove the merge commit from the PR. you might want to rebase onto the master or just cherry-pick your change.

@stale
Copy link

stale bot commented Jan 5, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you are a maintainer or core committer, please follow-up on this issue to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@stale stale bot added the stale label Jan 5, 2019
Signed-off-by: shangfufei <shangfufei@inspur.com>
@stale stale bot removed the stale label Jan 5, 2019
@liewegas
Copy link
Member

liewegas commented Jan 6, 2019

@shangfufei can you rebase this on top of current master so it is a single git commit?

@shangfufei
Copy link
Author

@shangfufei can you rebase this on top of current master so it is a single git commit?

Do you mean I need to submit it directly in the master branch?

@shangfufei
Copy link
Author

This modification is currently in the wip-async-bugfix-23600 branch, which needs to be merged into the master trunk branch if detection is not a problem with conventional operations.

@smithfarm
Copy link
Contributor

smithfarm commented Jan 15, 2019

@shangfufei I think what @liewegas is asking for is to squash the three commits in this PR [1] (using git rebase -i) into a single commit so the PR has only one commit instead of three.

[1] https://github.com/ceph/ceph/pull/21296/commits

(Note, you may need to do a simple git fetch upstream ; git rebase upstream/master, where upstream is the name of your ceph/ceph remote, first, just to get rid of the merge commit. Then squash using git rebase -i.)

@stale
Copy link

stale bot commented Mar 16, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you are a maintainer or core committer, please follow-up on this issue to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@stale stale bot added the stale label Mar 16, 2019
@stale
Copy link

stale bot commented Jun 14, 2019

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@stale stale bot closed this Jun 14, 2019
@liewegas liewegas reopened this Jun 14, 2019
@stale stale bot removed the stale label Jun 14, 2019
@xiexingguo
Copy link
Member

@liewegas Already merged by #27599

@tchaikov tchaikov closed this Jun 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants