Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mkenigs
Copy link
Contributor

@mkenigs mkenigs commented Aug 15, 2024

Currently, if two instances of process-compose are started with the same unix socket, the first instance is orphaned without any way to shut it down:

> process-compose up -u /tmp/sock --tui=false >/dev/null 2>&1 &
[1] 52138

> process-compose up -u /tmp/sock --tui=false >/dev/null 2>&1 &
[2] 52217

> process-compose down -u /tmp/sock
[2]  + done       process-compose up -u /tmp/sock --tui=false > /dev/null 2>&1

> process-compose down -u /tmp/sock
24-08-07 11:59:19.436 FTL failed to stop project error="Post \"http://unix/project/stop/\": dial unix /tmp/sock: connect: no such file or directory"

> pgrep process-compose
52138

Instead of unconditionally removing an existing unix socket, error if it is already in use.

Currently, if two instances of process-compose are started with the same
unix socket, the first instance is orphaned without any way to shut it
down:

```
> process-compose up -u /tmp/sock --tui=false >/dev/null 2>&1 &
[1] 52138

> process-compose up -u /tmp/sock --tui=false >/dev/null 2>&1 &
[2] 52217

> process-compose down -u /tmp/sock
[2]  + done       process-compose up -u /tmp/sock --tui=false > /dev/null 2>&1

> process-compose down -u /tmp/sock
24-08-07 11:59:19.436 FTL failed to stop project error="Post \"http://unix/project/stop/\": dial unix /tmp/sock: connect: no such file or directory"

> pgrep process-compose
52138
```

Instead of unconditionally removing an existing unix socket, error if it
is already in use.
@sonarqubecloud
Copy link

Copy link
Owner

@F1bonacc1 F1bonacc1 left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@F1bonacc1 F1bonacc1 merged commit 14b33bc into F1bonacc1:main Aug 15, 2024
@mkenigs mkenigs deleted the check-socket branch August 15, 2024 20:25
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