On 20 Aug 2020, at 19:51, Esteban Maringolo <emaringolo@gmail.com> wrote:
Hi,
I'm replying to the list as well... because the last two mails got replied to our personal addresses.
Oh, I did not notice that, that was not my intention.
On Thu, Aug 20, 2020 at 11:55 AM Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 20 Aug 2020, at 15:31, Esteban Maringolo <emaringolo@gmail.com> wrote:
Hi Sven,
If a socketstream doesn't know the state of the connection, then what is the #socketIsConnected method for? In particular the #isOtherEndClosed test.
ZdcAbstractSocketStream>>#socketIsConnected ^socket isConnected and: [ socket isOtherEndClosed not ]
I don't know what is going on inside Socket, I just stated my opinion.
Maybe there is something to investigate here?
Is it not so that in Docker all network connections in/out/between instances are mediated by some management software ? I even thought it was nginx. Maybe I am totally wrong here.
With logging enabled, I can do the following:
$ grep P3 server-2020-08-20.log | grep CONNECT | tail -n 20 <snip> 2020-08-20 14:43:06 [P3] 30513 DISCONNECTING psql://client-xyz:hiddenpassword@client-xyz-db:5432/client-xyz 2020-08-20 14:44:06 [P3] 30516 CONNECTED psql://client-xyz:hiddenpassword@client-xyz-db:5432/client-xyz 2020-08-20 14:44:06 [P3] 30516 DISCONNECTING psql://client-xyz:hiddenpassword@client-xyz-db:5432/client-xyz 2020-08-20 14:44:06 [P3] 30517 CONNECTED psql://client-xyz:hiddenpassword@client-xyz-db:5432/client-xyz 2020-08-20 14:44:06 [P3] 30517 DISCONNECTING psql://client-xyz:hiddenpassword@client-xyz-db:5432/client-xyz
The number after [P3] is the session identifier (backend process id) of that connection. You should see each one being opened and closed in pairs.
Yes, I noticed the pid, and compared it with what I had on the pg_stat_activity table.
Right.
I don't get the CONNECTED log because there is no way to set the logging in the P3DatabaseDriver before it creates (and connects) the P3Client. Maybe there could be a setting on P3Client class to set verbosity globally? Or at the P3DatabaseDriver instead.
What if you change P3DatabaseDriver >> connect: aLogin connection := self connectionClass new. connection host: aLogin host; port: aLogin port asInteger; database: aLogin databaseName; user: aLogin username; password: aLogin password. connection connect by inserting verbose: true before the last statement. You could also make a subclass of P3DatabaseDriver.
Summarizing... I'm pretty confident that P3 works correctly and also the PG server. At this point I'm factoring out what might be causing this. It's an issue that only happens to me in production, and I don't have a better instrumentation in place to debug it.
Again, thanks for the support.
Regards.