Avoid unreference variable 'st' error if file was removed. Raise exception if unrecognized environment error from os.stat#413
Conversation
| self._log_info('file removed') | ||
| self.close() | ||
| return | ||
| else: |
There was a problem hiding this comment.
No need for an else since you return already.
There was a problem hiding this comment.
@josegonzalez trying to return only if errorcode is for file not found, else raise the exception since I'd imagine other errors stat-ing the file would be unexpected.
There was a problem hiding this comment.
Right, what I'm saying is remove the else and de-dent the raise.
There was a problem hiding this comment.
Ok makes sense. Done.
…ption if unrecognized environment error from os.stat
e3cd738 to
4f40120
Compare
|
@josegonzalez lmk if I need to add anything else. Would we be able to get this into an upcoming release? |
|
@josegonzalez just wondering, will there be a release of this soon? I need this change as currently during logrotate, sometimes this bug causes beaver to crash (old file rotated, new file not yet created hits this case). If you'll be waiting a while to do a release, I'll just have to pip install from github to get the change., which is fine. However, would be nice to have a new version :-). |
|
I forgot to make a release because I was playing video games. Let me see what I can do. |
|
Done, 36.2.1 was released. |
|
Thanks!! |
Unit tests passing.
Did a manual test, and no crash, tailed file gets removed, and is added back if it appears again now.