Magpie should delete its socket automatically on startup #19

Closed
opened 2022-11-02 20:13:53 +00:00 by mars · 2 comments
Owner

No, it is not intended behavior for Magpie to ever leave a socket still active since it should always be able to exit safely, but on the occasion that it does, it should not make the user clean up its mess for it.

New setup steps for Magpie:

  1. Check if the socket already exists on the filesystem.
  2. Somehow check if the socket is still active. This could be a connection attempt, or maybe there's some other way to check if a socket is active.
  3. If it's inactive, delete the socket file, and log a warning that the old socket was not cleaned up.
No, it is not intended behavior for Magpie to ever leave a socket still active since it should always be able to exit safely, but on the occasion that it does, it should not make the user clean up its mess for it. New setup steps for Magpie: 1. Check if the socket already exists on the filesystem. 2. Somehow check if the socket is still active. This could be a connection attempt, or maybe there's some other way to check if a socket is active. 3. If it's inactive, delete the socket file, and log a warning that the old socket was not cleaned up.
mars added the
bug
label 2022-11-02 20:13:53 +00:00
Author
Owner

Looks like the best way to test if a socket is still active is just to connect: https://unix.stackexchange.com/questions/556748/how-to-check-whether-a-socket-is-listening-or-not

If the socket is active, connection will be successful. If not, the connection will be refused.

Looks like the best way to test if a socket is still active is just to connect: https://unix.stackexchange.com/questions/556748/how-to-check-whether-a-socket-is-listening-or-not If the socket is active, connection will be successful. If not, the connection will be refused.
roux was assigned by mars 2022-11-27 04:35:01 +00:00
Author
Owner

By the way, when I say "log a warning," just use eprintln!() for now. Actual logging will be covered by #13.

By the way, when I say "log a warning," just use eprintln!() for now. Actual logging will be covered by #13.
mars closed this issue 2022-12-04 21:39:26 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: canary/canary-rs#19
No description provided.