-
Notifications
You must be signed in to change notification settings - Fork 1
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
wip for #196 but also fixing #198 #201
base: development
Are you sure you want to change the base?
Conversation
adding skip of identity generation for hard links. adding skip of identity generation for non-files.
still crashes but _create/ replaced by _new & _free (was not cleaning up before.) It still crashes in init_ex for file removal... odd.
there was a global variable rmdir_in_progress, but it wasn't catching all events. Decided on an API change instead. now the sr_post related event processing requires an rmflags parameter.
This branch had been started ... oh a month ago... so the conflicts were there based on other merged patches... so I merged to it to get rid of the conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me, but I noticed one possible error with the rmflags (I put a comment on it)
} else { | ||
sr_post(sr_c, oldname, NULL); | ||
sr_post(sr_c, oldname, NULL, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it correct for rmflags
to be 0
here, where sb is NULL?
const int rmflags * 0 -- sb MUST not be null, this is not a remove event. * 1 -- sb==NULL this is a file (non-directory) removal. * 2 -- sb==NULL this is a directory removal.
close #198
I have been working on the hpc-mirorring, finding edge cases that don´t work. One such case is events to reflect directory removals. I noticed that, as per #198 the events produced by the C for rmdir events (or rm -rf) were not being produced with the correct fileOp field:
when it should have:
on the Python side, you need the both attributes when trying to mirror an rmdir.
So that was one problem. Another problem was that when doing something like "rm -rf" some of the remove events are for directories. The way to create a file removal event with the current API is to provide a NULL pointer to the file status struct. The file status struct normally provides the file type (file, directory link, etc...)
since the removal event doesn't have this information, the API needs to be changed to allow communicating
that the file being removed is a directory. so added rmflags to a whole slew of routines (two or three levels deep.)
So that's the logic for #198... Unfortunately I was working on that in a branch that was originally about #196. I tried cherry-picking off the above to just PR cleanly for #198, but it turned out these patches depend on the earlier ones... so I needed to PR the whole thing.
The rest of these patches are cleanups that try to make the code cleaner, while testing thoughts about #196.
None of them fix it.
My guess as to the real problem is for #196: when we add process cleanup routine, it gets added after posix thread cleanup has occurred. when we try to close a file, it calls posix thread code where those data structures have already been cleaned up.
So what are these patches?