-
Notifications
You must be signed in to change notification settings - Fork 69
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 instances can be run if the pid file is specified as a relative path #426
Comments
We should def error out if the configuration is the same. However, it should be possible to run multiple instance on the same server - like one for the primary instance, and another for standby |
The only "quick" way to find out if the configuration is (almost) the same is the failure of
Good point, but while it is immediate to find out a "misrun" by the user when using the same configuration for multiple instances, if the |
@fluca1978 I couldn't reproduce this, but I may have misunderstood the bug. What I am trying to do is set the If you could give me more details I could work something out. |
When I launch the second instance, I got a bind error too, but the instance continues to run. Is your second instance aborting? That could be due to the presence or absence of other network cards? |
Yes, mine aborts exactly after returning from $ ./pgagroal -c pgagroal.conf
2024-04-03 10:54:45 DEBUG configuration.c:2656 PID file automatically set to: [./pgagroal.2345.pid]
2024-04-03 10:54:45 DEBUG network.c:648 server: bind: localhost:2345 (Address already in use)
2024-04-03 10:54:45 FATAL main.c:924 pgagroal: Could not bind to localhost:2345
I have researched this and it's possible that it is a matter of how the OS deals with |
Apprently the problem is with ``host
but when set to |
If the configuration `host` is set to `*`, meaning all the interfaces, the `pgagroal_bind` function was always returning a true value even if no available bind addresses were left. In order to fix this, the commit tests if the `star_length` variable has been set to something non-zero, otherwise no more sockets are available (bound) and the function returns a `1` to indicate an error. Close agroal#426
If the configuration `host` is set to `*`, meaning all the interfaces, the `pgagroal_bind` function was always returning a true value even if no available bind addresses were left. In order to fix this, the commit tests if the `star_length` variable has been set to something non-zero, otherwise no more sockets are available (bound) and the function returns a `1` to indicate an error. Close #426
If the configuration `host` is set to `*`, meaning all the interfaces, the `pgagroal_bind` function was always returning a true value even if no available bind addresses were left. In order to fix this, the commit tests if the `star_length` variable has been set to something non-zero, otherwise no more sockets are available (bound) and the function returns a `1` to indicate an error. Close agroal#426
On 8a1d641 having
pid_file = relative_file.pid
makespgagroal
able to run multiple times from different directories.Example: running the first instance:
Running the second instance from a different directory:
I think we should either force an absolute
pid_file
, therefore aborting execution ifpid_file
is not absolute, or abort the execution if thebind
fails. In any case, the fact thatbind
failure allows for continuation is suspicions.The text was updated successfully, but these errors were encountered: