Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple hostname support no longer working #280

Closed
packagethief opened this issue Jun 21, 2021 · 1 comment · Fixed by #281
Closed

Multiple hostname support no longer working #280

packagethief opened this issue Jun 21, 2021 · 1 comment · Fixed by #281
Assignees
Labels

Comments

@packagethief
Copy link

#101 added support for sharing a single app instance with multiple hostnames by pointing symlinks to the same app. As of version 0.15.2, this is no longer working.

It looks like puma-dev tries to bind to alternative hostnames to same socket as the already running app:

! Booting app 'bc3' on socket /Users/jeff/.puma-dev/bc3/tmp/puma-dev-9798.sock
bc3[20138]: Puma starting in single mode...
bc3[20138]: * Puma version: 5.3.2 (ruby 2.7.2-p137) ("Sweetnighter")
bc3[20138]: *  Min threads: 0
bc3[20138]: *  Max threads: 5
bc3[20138]: *  Environment: development
bc3[20138]: *          PID: 20138
bc3[20138]: * Listening on unix:/Users/jeff/.puma-dev/bc3/tmp/puma-dev-9798.sock
bc3[20138]: Use Ctrl-C to stop
! App 'bc3' booted

! Booting app 'bc3-091a2a85' on socket /Users/jeff/.puma-dev/bc3-cdn/tmp/puma-dev-9798.sock
! App 'bc3-091a2a85' booted
bc3-091a2a85[20511]: Puma starting in single mode...
bc3-091a2a85[20511]: * Puma version: 5.3.2 (ruby 2.7.2-p137) ("Sweetnighter")
bc3-091a2a85[20511]: *  Min threads: 0
bc3-091a2a85[20511]: *  Max threads: 5
bc3-091a2a85[20511]: *  Environment: development
bc3-091a2a85[20511]: *          PID: 20511

bc3-091a2a85[20511]: RuntimeError: There is already a server bound to: /Users/jeff/.puma-dev/bc3-cdn/tmp/puma-dev-9798.sock
! Killing 'bc3-091a2a85' (20511) - 'stdout/stderr closed'
* App 'bc3-091a2a85' shutdown and cleaned up

I haven't tried to bisect, but I suspect this changed in #270.

@nonrational nonrational self-assigned this Jun 25, 2021
@nonrational
Copy link
Member

Yeah, I'm seeing a similar error after 3c14306.

Definitely a bug somewhere.

FWIW, it does appear to be short-lived. Given an app aliased as abc.puma and xyz.puma, after requesting abc.puma/ then xyz.puma/ then abc.puma/ then xyz.puma/, both respond correctly. 🙃

jorgemanrubia added a commit to jorgemanrubia/puma-dev that referenced this issue Jul 9, 2021
This fixes a problem where it fails to reuse the same instance of the app
when using multiple hostnames with different names (multiple symlinks pointing
to the same folder).

The bug was introduced in puma#270. The patch is based on adding the checksum in
all cases when a symlink is involved, not only when the names don't match. If not,
it can happen that it's not added if the name matches for the first execution, which
results in not finding the app instance later, resulting in an error "There is already
a server bound to..."

Fixes puma#280
nonrational pushed a commit that referenced this issue Jul 9, 2021
This fixes a problem where it fails to reuse the same instance of the app
when using multiple hostnames with different names (multiple symlinks pointing
to the same folder).

The bug was introduced in #270. The patch is based on adding the checksum in
all cases when a symlink is involved, not only when the names don't match. If not,
it can happen that it's not added if the name matches for the first execution, which
results in not finding the app instance later, resulting in an error "There is already
a server bound to..."

Fixes #280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants