-
Notifications
You must be signed in to change notification settings - Fork 3
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
Make ngnfs clients exit with meaningful error codes #8
Open
valversity
wants to merge
17
commits into
versity:main
Choose a base branch
from
valversity:val/clientExit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bef0f9b
to
09ee31a
Compare
09ee31a
to
45f9067
Compare
thread_stop_wait() already does a thread_stop_indicate() first thing, no need to do it twice. Signed-off-by: Valerie Aurora <val@versity.com>
The return code is alreadly negative (-1); setting itself to its negative made it positive and broke the error handling code which assumes -ERRNO. Instead set it to -errno. Signed-off-by: Valerie Aurora <val@versity.com>
The send thread of a peer socket may be asleep on a wait queue. Wake it so that the socket destroy can complete. Signed-off-by: Valerie Aurora <val@versity.com>
end_write_io was clearing the dirty bit on the set, but not the block itself. Signed-off-by: Valerie Aurora <val@versity.com>
Remove the thread_should_return() check from the outer loop so that we can't return without fully draining the queue. Signed-off-by: Valerie Aurora <val@versity.com>
ngfns_pfs_read_inode() already destroys the transaction, no need to do it again.
We are renaming the manifests to maps and preparing for them to be provided by a server. This is the initial version of the part of the maps code shared by both kernel and user. Nothing uses it yet. Signed-off-by: Valerie Aurora <val@versity.com>
The mapd server will replace specifying the devd addresses on the command line. Signed-off-by: Valerie Aurora <val@versity.com>
Add an ngnfs-cli subcommand to ask for a map from the mapd server. Signed-off-by: Valerie Aurora <val@versity.com>
Make all of ngnfs use the new maps code instead of the old manifests. Signed-off-by: Valerie Aurora <val@versity.com>
Now that we are using the new maps code everywhere, delete the unused manifest code. Signed-off-by: Valerie Aurora <val@versity.com>
Add thread_shutdown_all() which sends a SIGUSR1 to the main supervisory thread, which can then wake its child which is actually doing ngnfs things with signals off. Allows the program to exit cleanly for tests. Signed-off-by: Valerie Aurora <val@versity.com>
Add a function to shutdown in-progress ngnfs threads in the event of a fatal fs-wide error like being unable to connect to the devd or mapd servers. Signed-off-by: Valerie Aurora <val@versity.com>
If we get any connect() error, shut down the entire file system. Signed-off-by: Valerie Aurora <val@versity.com>
Mount now requests the maps but does not wait for them to arrive before returning. Unmount now uses ngnfs_shutdown to quiesce work and wake blocked threads before calling the destroy routines.
Make debugfs exit if connect() fails to the mapd or devd server. At some point this should be a flag or a timeout, but for now this lets us write tests. Signed-off-by: Valerie Aurora <val@versity.com>
Now that children can signal parents to quit, add a quit command to debugfs to exit cleanly. Signed-off-by: Valerie Aurora <val@versity.com>
65c4cd2
to
cd760b3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So that we can write automated tests, make all the ngnfs clients able to exit with meaningful error codes, including in the case that the mapd or devd server cannot be connected to.
Includes the mapd server patches, plus some little one-liner bugs in the (untested) ngnfs shutdown code, then the actual exit patches.