-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Vweb DatabasePool connection closed unexpectedly after idle time #19895
Comments
Hi can you confirm the idle connection is closed by V and not the postgres server? There is a setting in postgres where you can change the idle timeout. I've been running a vweb app with the connection pool for 4 months now without breaking, I want to confirm it this could have happened due to a change between that time |
Hello Casper
Yes postgres is closing the connection unexpectedly after a long idle
period. I have worked around the issue with a routine to make a simple
query every 20 minutes..by default PG docker setup does not come with much
settings however their docs don't really specify or seem to support one
long running connection, hence the idea of closing the connection and
reopening on demand
In any case thanks for the time and consideration and love the direction
and what v team is doing.
Im using v 0.4.3 on alpine container for development and testing the app on
alpine containers
Regards
Alberto
Regards
Alberto Ochoa
…On Sun, Nov 19, 2023, 05:08 Casper Küthe ***@***.***> wrote:
Hi can you confirm the idle connection is closed by V and not the postgres
server? There is a setting in postgres where you can change the idle
timeout.
I've been running a vweb app with the connection pool for 4 months now
without breaking, I want to confirm it this could have happened due to a
change between that time
—
Reply to this email directly, view it on GitHub
<#19895 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEV3V6Z345JNMHUZ43OSKTYFHLDVAVCNFSM6AAAAAA7NPIKC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJXHAYDQNBXHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I actually just experienced this issue today with mysql. Mysql disconnected the client for inactivity (code: 4031) |
I will take this issue into account for vweb2, the underlying implementation of the database pool has to change anyway. |
Ok, thanks for the update.
Regards
Alberto Ochoa
…On Mon, Nov 27, 2023, 05:44 Casper Küthe ***@***.***> wrote:
I will take this issue into account for vweb2, the underlying
implementation of the database pool has to change anyway.
—
Reply to this email directly, view it on GitHub
<#19895 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEV3V5CTKM7WOAH3U5BQBDYGRVHRAVCNFSM6AAAAAA7NPIKC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRXGU4DGNZRHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Describe the bug
Using a similar setup app as shown here: #18191
and Postgresql database, I noticed that after idle db connection the server unexpectly closes the connection and the container running the vweb app crashes, Is there a way to reset the db connection after a specific period of time (before the idle time of the server) or when the db connections are needed to be created (on demand)?
Reproduction Steps
application setup and running Ok
wait about 20 minutes Idle and attempt to request a resource on the DB the server closes the connection unexpectedly
Expected Behavior
Current Behavior
1 long standing connection is closed after idle period
1 possible workaround is to setup a health check to make a query thereby keeping the connection busy
Possible Solution
1 possible workaround is to setup a health check to make a query thereby keeping the connection busy
Additional Information/Context
No response
V version
0.4.2
Environment details (OS name and version, etc.)
Docker alpine latest (vlang 0.4.2)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: