Skip to content

Conversation

nirs
Copy link
Member

@nirs nirs commented Sep 25, 2024

We have a race (time of check, time of use) when deleting a vm with
--force. We first list the file in the instance dir, and then delete
matching files. "ssh.sock" is consistently already deleted when we try
to remove it, creating unwanted noise in the log.

"ssh.sock" is probably removed by other code that may need need to
remove it. To make this easy to improve we still log the event in debug
level.

Also fix a log issue in this same function.

Fixes: #2635

Arguments were in the wrong order, showing:

    INFO[0000] Removing /Users/nsoffer/.lima/c1 under "*.pid *.sock *.tmp"

Fix argument order and clarify the code a little bit to avoid such
failures in the future.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@nirs nirs changed the title Suppress error if ssh.sock is already deleted Suppress error if file is already deleted Sep 25, 2024
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

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

LGTM, but change the DebugfDebug call because the argument is not a format string.

We have a race (time of check, time of use) when deleting a vm with
--force. We first list the file in the instance dir, and then delete
matching files. "ssh.sock" is consistently already deleted when we try
to remove it, creating unwanted noise in the log.

"ssh.sock" is probably removed by other code that may need need to
remove it. To make this easy to improve we still log the event in debug
level.

Fixes: lima-vm#2635
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@nirs
Copy link
Member Author

nirs commented Sep 26, 2024

@jandubois should be ready now, thanks for reviewing!

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@jandubois jandubois merged commit d3def6c into lima-vm:master Sep 26, 2024
27 checks passed
@jandubois jandubois added this to the v1.0 milestone Sep 26, 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.

ERRO[0000] remove /Users/user/.lima/instance/ssh.sock: no such file or directory
2 participants