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

Make ngnfs clients exit with meaningful error codes #8

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

valversity
Copy link
Contributor

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.

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>
@valversity valversity force-pushed the val/clientExit branch 2 times, most recently from 65c4cd2 to cd760b3 Compare January 8, 2025 19:13
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.

1 participant