Open petersilva opened 10 months ago
uh... not putting a priority on this or anything... I'm just thinking that since you're testing this stuff, this should be on your radar next time you're in the area...
I remember this being painful... it might not be a feasible/worthwhile thing to do.
I committed the changes to the tests that I had made to get the tests working better on ppp. They're on the https://github.com/MetPX/sarrac/tree/test_tweaks branch.
so when processes do not close files, the exit_cleanup() routine in libsr3shim.c has to resolve the pathnames for open file descriptors. it uses realpath to do that. I does not know that the actual path was opened using a symlink...
so we have, in shim_post.sh for example... files being closed their paths are always "realpathed" so posting via symbolic paths fails.
choice between post_baseDir=${HOME}:
[pas037@ppp6login-003 metpx-sr3c]$ [pas037@ppp6login-003 metpx-sr3c]$ grep ERROR shim_post.log
2024-11-18 17:49:52,206 [ERROR] shim posting outside of post_baseDir (/home/pas037) invalid path: /fs/homeu2/ssc/di/pas037/Sarracenia/metpx-sr3c/hoho
2
and post_baseDir=realpath ${HOME}
[pas037@ppp6login-003 metpx-sr3c]$ grep ERROR shim_post.log
2024-11-18 18:33:14,541 [ERROR] shim posting outside of post_baseDir (/fs/homeu2/ssc/di/pas037) invalid path: /home/pas037/Sarracenia/metpx-sr3c/sub_dir1
2024-11-18 18:33:14,587 [ERROR] shim posting outside of post_baseDir (/fs/homeu2/ssc/di/pas037) invalid path: /home/pas037/Sarracenia/metpx-sr3c/sub_dir2
2024-11-18 18:33:14,655 [ERROR] shim posting outside of post_baseDir (/fs/homeu2/ssc/di/pas037) invalid path: /home/pas037/Sarracenia/metpx-sr3c/haha
2024-11-18 18:33:14,722 [ERROR] shim posting outside of post_baseDir (/fs/homeu2/ssc/di/pas037) invalid path: /home/pas037/test/hoho2.log
2024-11-18 18:33:14,744 [ERROR] shim posting outside of post_baseDir (/fs/homeu2/ssc/di/pas037) invalid path: /home/pas037/Sarracenia/metpx-sr3c/hihi
2024-11-18 18:33:14,765 [ERROR] shim posting outside of post_baseDir (/fs/homeu2/ssc/di/pas037) invalid path: /home/pas037/test/hoho2.log
2024-11-18 18:33:14,786 [ERROR] shim posting outside of post_baseDir (/fs/homeu2/ssc/di/pas037) invalid path: /home/pas037/Sarracenia/metpx-sr3c/dirone
2024-11-18 18:33:14,809 [ERROR] shim posting outside of post_baseDir (/fs/homeu2/ssc/di/pas037) invalid path: /home/pas037/Sarracenia/metpx-sr3c/dirone/dirtwo
202
so in either case, you get a clash in some cases between the logical path used to reference the file, and the realpath.
so the problem is here:
https://github.com/MetPX/sarrac/blob/c7b91a2afea14bf4fb23f46bf89a45179689f778/sr_post.c#L725-L738
Need to allow for ther post_baseDir to be present in symlinked and realpath form not just compare strings.
the removal of the post_baseDir from the full path... needs to work even when given realpath, when post_baseDir is a symlinked one.
... we have a reverse problem... where if post_baseDir is the realpath... then when given a symlinked path... it also requires conversion... but because realpath conversion is of the input path is done by realpath_adjust and such a setting is only valid with realpathPost=True, the reverse case should never occur.
So by fixing the first case, we should be solving the entire problem.
so likely want to:
alternative solutions discussed:
with the merge we have definitely made excellent progress... but not done... make test_shim_post is good... but later ones still fail...
I'm optimistic that the fix for redirection will fix at least some of those, I'll test that branch again
purpose is to get the tests to pass when run on supercomputer.
branches with bits of work on this:
which was merged from:
the non_utf8 and test_shim failures in the normal cases have since been isolated and merged, and so the work here is to extract the symlink related patches and get them into something coherent to merge, so in future, people can run the test_shim on the supercomputer.