ut-osa / assise

GNU General Public License v2.0
57 stars 30 forks source link

Cleanup of threads managing connections to SharedFS #20

Open OmSaran opened 3 years ago

OmSaran commented 3 years ago

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!

wreda commented 2 years ago

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.