OK, sorry to revisit this, but it keeps happening and I'm not clear how to 
fix it.  I thought I had.  

I had to reboot.  The crontab was running and had a connection to a 
localhost table.  The logger shows the disconnection basically instantly 
after the last query was received by the script.  So I am assuming the 
*pool* had nothing for a new request to use (basically empty). 

2020-05-12 02:03:12.215 EDT [15538] LOG:  execute <unnamed>:  UPDATE 
ig_hashtags SET tagcount = $1, updated = now() WHERE hashtag = $2 
2020-05-12 02:03:12.215 EDT [15538] DETAIL:  parameters: $1 = '3900000', $2 
= 'rawfood'
2020-05-12 02:03:12.221 EDT [15538] LOG:  disconnection: session time: 0:02:
10.675 user=rich database=rich host=[local]
2020-05-12 02:03:12.221 EDT [15537] LOG:  disconnection: session time: 0:02:
10.684 user=rich database=rich host=localhost port=52273
 # new browser request denied here.
2020-05-12 02:09:10.824 EDT [15823] LOG:  connection received: host=[local] 
2020-05-12 02:09:10.826 EDT [15823] LOG:  connection authorized: user=rich 
database=rich

That browser call resulted in this error:

Error at 2:09 am:
PG::ConnectionBad: could not connect to server: Connection refused
 Is the server running on host "localhost" (::1) and accepting
 TCP/IP connections on port 5432?
could not connect to server: Connection refused
 Is the server running on host "localhost" (fe80::1) and accepting
 TCP/IP connections on port 5432?
could not connect to server: Connection refused
 Is the server running on host "localhost" (127.0.0.1) and accepting
 TCP/IP connections on port 5432?
 (Sequel::DatabaseConnectionError)

My goal is to avoid these errors completely.  I know you've told me that I 
can check the pool every single time, and you've also said it has 
overhead.  I'd like to avoid the overhead.  You've also said if there's 
nothing valid in the pool, that a new request would be made.  So I'm 
confused why it's reporting there's no valid connections, if you've said it 
would just open a new one.

Am I missing how this works?  That validation is set here:

DBHQ.pool.connection_validation_timeout = 6

The previous connection to localhost (the crontab connection) looks like it 
closed 6 minutes before my browser request.  My *validation* is set for 6 
seconds, and I'm still getting errors.  None of this seems to be coming 
together.  I just don't see how the validator is really anything but a shot 
in the dark with a guess, and even at 6 seconds it's failing.  

Is there no scenario where if there's no connections, that it just opens a 
new one?  

Cheers



-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/225c4308-9af9-4edf-b2fc-6b4447a06f24%40googlegroups.com.

Reply via email to