Closed MatthijsBurgh closed 2 years ago
@meyerj friendly ping ;)
@timonegk could you please take a quick look at this one. If I am wrong, we can just close this one.
No, I'm pretty sure you're right. It would change the behavior a bit because the whole log file renaming and cleaning is also done in close()
, but I think that would be for the best.
Each stage has its own logger. So in the old situation, the logger would be deleted after each stage iteration in case of not reaching the close call, which will then be after release the lock instead of before. So I think the behavioural change is very limited.
All tests in #719 succeed.
@meyerj friendly ping ;)
Not sure why I have been pinged here? I am neither a maintainer nor contributor to that part of the code and not aware of how logging in catkin_tools works. However, I added a small suggestion to #719.
@meyerj I have really no idea why I have tagged you in this one 😕. Though thanks for your comment in #719.
I am not experiencing any issues. But I was scrolling a bit through the code and found that in
async_job
the logger isn't closed, when there is any interruption, Exception, break, continue.https://github.com/catkin/catkin_tools/blob/6d9f6fdc86c56850e521e6a665b89b033612a2f8/catkin_tools/execution/executor.py#L172-L179
I think this is incorrect. The logger should always be closed.
A
finally
will also be executed on areturn
,break
,continue
. See https://docs.python.org/3/reference/compound_stmts.html#finallySo by just moving the
logger.close()
to the finally should do the job.