Skip to content

Conversation

patrickelectric
Copy link
Member

This fixes the lsof operation that is blocking and using 100% of cpu in some cases.

2024-02-27 19:22:03.150 | DEBUG    | __main__:zip_files:29 - Deleted file: /shortcuts/system_logs/ardupilot-manager/logfile_02-22-2024_10:39:21.log
2024-02-27 19:22:08.175 | ERROR    | commonwealth.utils.general:file_is_open:46 - Failed to check if file /shortcuts/system_logs/ardupilot-manager/logfile_02-27-2024_11:30:22.log is open, Command '['lsof', PosixPath('/var/logs/blueos/services/ardupilot-manager/logfile_02-27-2024_11:30:22.log')]' timed out after 5 seconds

return result.returncode == 0
except Exception as error:
logger.error(f"Failed to check if file {path} is open, {error}")
return True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If timed out, the file is considered open.

just commenting so we think about the behavior we are choosing

@patrickelectric patrickelectric merged commit f8364f1 into bluerobotics:master Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants