Open R7R8 opened 7 years ago
thx, please check 32f2b15 commit work or not
Thank you for your response.I will check.
It seems 32f2b15
commit can solve a part of problem, but sometimes it may still fail.
The situation failed is that futil.IsExist(fpath)
is true, but filepath.EvalSymlinks(fpath)
can not return.
Maybe we should take restricted control to check if the fpath is ready.
How about 0253f9f ? I add one more checking before filepath.EvalSymlinks(fpath)
.
It seems that you put the new codes in the wrong place.
filepath.EvalSymlinks(fpath)
fails in the function waitWatchEvent
, not in the function Start
Today I remove the code filepath.EvalSymlinks(fpath)
in the function waitWatchEvent
, then the application goes well. So I can ensure that the problem happens in filepath.EvalSymlinks(fpath)
.
OK, I use a wrap function for all filepath.EvalSymlinks(fpath)
in 8360d5a .
I have two machines to test gogstash. Tomcat logs rotate one hour in one, one minute in the other.
The former goes well, but the latter still has problem. The problem is still that filepath.EvalSymlinks(fpath)
can not return
Sometimes filepath.EvalSymlinks(fpath)
fails like this:
Error: Get symlinks failed: ; lstat /XXX/XXX/XXX/localhost_access_log.log: no such file or directory
There is a situation that the code below may fail.
For example do operations
Write, Rename, Create
to the fpath.When the waitWatchEvent() have processed the Write event, it will enter the waitWatchEvent() again. But now, the fpath doesn't exit or the fpath is creating. Under this situation, the
filepath.EvalSymlinks
may fail.It is expected to do:
but the reality is:
I fix this problem temporarily by adding below codes before
filepath.EvalSymlinks(fpath)
.