assise icon indicating copy to clipboard operation
assise copied to clipboard

Cleanup of threads managing connections to SharedFS

Open OmSaran opened this issue 4 years ago • 1 comments

I am trying to run a simple program to init_fs() and shutdown_fs() Assise multiple times in the same process.

But I faced some issues with the socket connections being cleaned up properly. My guess is that Assise previously relied on OS cleaning up the socket descriptors during the cleanup of the process, which will not happen if we reinitialize LibFS in the same process.

I have taken a stab at fixing this and it works for my specific use case where I use it in local mode (strata mode).

Here is the pull request: #19

Would be great if you could review this.

Also, here is the sample program that I was trying to make it work for:

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>

#include <mlfs/mlfs_interface.h>


int main() {
    int i;
    for(i=1; i<=3; i++) {
        printf("Init %d \n", i);
        init_fs();

        printf("Shutdown %d \n", i);
        shutdown_fs();
        sleep(3);
    }

    return 0;
}

Thanks!

OmSaran avatar Nov 18 '21 20:11 OmSaran

Getting to this now.

Thanks for the PR! This looks okay to me for a single-node setup. I'm currently testing to see if it works with RDMA. Will hopefully merge it in soon.

wreda avatar Nov 30 '21 00:11 wreda