From postgres@kiwi-fraser.net Thu Dec 16 14:20:29 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 21ABB3CAA78 for ; Thu, 16 Dec 2004 14:20:29 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86524-05 for ; Thu, 16 Dec 2004 14:20:21 +0000 (GMT) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by svr1.postgresql.org (Postfix) with ESMTP id 9DC263CAA73 for ; Thu, 16 Dec 2004 14:20:20 +0000 (GMT) Received: from DonAcer (unknown [84.12.26.148]) by smtp.nildram.co.uk (Postfix) with SMTP id D37A82537CB for ; Thu, 16 Dec 2004 14:20:13 +0000 (GMT) Message-ID: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> From: "Donald Fraser" To: "[ADMIN]" Subject: Notifications Date: Thu, 16 Dec 2004 14:20:07 -0000 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002B_01C4E37A.57D57A20" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.028 tagged_above=0 required=5 tests=HTML_60_70, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200412/159 X-Sequence-Number: 15745 This is a multi-part message in MIME format. ------=_NextPart_000_002B_01C4E37A.57D57A20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hiya, I'm having problems receiving NOTIFY messages when outside our local = network. I have dissabled firewall setting but nothing seems to fix the problem. I was wandering if NOTIFY messages use UDP or TCP, as that would = possibly explain why they are not arriving? Any ideas would be welcom Cheers Donald Fraser ------=_NextPart_000_002B_01C4E37A.57D57A20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hiya,
I'm having problems receiving NOTIFY = messages when=20 outside our local network.
I have dissabled firewall = setting but nothing=20 seems to fix the problem.
I was wandering if NOTIFY messages use = UDP or TCP,=20 as that would possibly explain why they are not arriving?
 
Any ideas would be welcom
 
Cheers
Donald = Fraser
------=_NextPart_000_002B_01C4E37A.57D57A20-- From tgl@sss.pgh.pa.us Thu Dec 16 16:41:57 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3A50C3B69E5 for ; Thu, 16 Dec 2004 16:41:57 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44397-04 for ; Thu, 16 Dec 2004 16:41:50 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id C9CAF3B69C9 for ; Thu, 16 Dec 2004 16:41:50 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id iBGGflx3025439; Thu, 16 Dec 2004 11:41:47 -0500 (EST) To: "Donald Fraser" Cc: "[ADMIN]" Subject: Re: Notifications In-reply-to: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> References: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> Comments: In-reply-to "Donald Fraser" message dated "Thu, 16 Dec 2004 14:20:07 +0000" Date: Thu, 16 Dec 2004 11:41:47 -0500 Message-ID: <25438.1103215307@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/167 X-Sequence-Number: 15753 "Donald Fraser" writes: > I'm having problems receiving NOTIFY messages when outside our local = > network. > I have dissabled firewall setting but nothing seems to fix the problem. > I was wandering if NOTIFY messages use UDP or TCP, as that would = > possibly explain why they are not arriving? You're certainly barking up the wrong tree. NOTIFY messages go through your regular database connection --- if you are able to connect to the database at all, you can get NOTIFY messages. regards, tom lane From postgres@kiwi-fraser.net Thu Dec 16 17:01:31 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EAF203B6E66 for ; Thu, 16 Dec 2004 17:01:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51762-03 for ; Thu, 16 Dec 2004 17:01:17 +0000 (GMT) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by svr1.postgresql.org (Postfix) with ESMTP id 1429F3B6ECA for ; Thu, 16 Dec 2004 17:01:16 +0000 (GMT) Received: from DonAcer (unknown [84.12.26.148]) by smtp.nildram.co.uk (Postfix) with SMTP id 61196274E33 for ; Thu, 16 Dec 2004 17:01:11 +0000 (GMT) Message-ID: <002801c4e390$d6633c40$6464a8c0@DonAcer> From: "Donald Fraser" To: "[ADMIN]" References: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> <25438.1103215307@sss.pgh.pa.us> Subject: Re: Notifications Date: Thu, 16 Dec 2004 17:01:04 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.014 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/170 X-Sequence-Number: 15756 Hmm I thought as much but I'm not really that up on socket connections to know whether a connection could share both TCP and UPD packet types. This leaves me rather clueless as to why I don't get NOTIFY messages accross the internet yet I can connect, send and receive sql statements no problems. Actually thinking about it now - connections to our sever accross the internet use SSL whilst local connections don't. Could there be some sort of problem with SSL ? I guess I can change the software to force local users to use SSL as another test. Other than that I'm lost as to what is happening to the messages.... Regards Donald Fraser ----- Original Message ----- From: "Tom Lane" To: "Donald Fraser" Cc: "[ADMIN]" Sent: Thursday, December 16, 2004 4:41 PM Subject: Re: [ADMIN] Notifications > "Donald Fraser" writes: >> I'm having problems receiving NOTIFY messages when outside our local = >> network. >> I have dissabled firewall setting but nothing seems to fix the problem. >> I was wandering if NOTIFY messages use UDP or TCP, as that would = >> possibly explain why they are not arriving? > > You're certainly barking up the wrong tree. NOTIFY messages go through > your regular database connection --- if you are able to connect to the > database at all, you can get NOTIFY messages. > > regards, tom lane > From mike@fuhr.org Thu Dec 16 17:07:42 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3939A3B7087 for ; Thu, 16 Dec 2004 17:07:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55287-01 for ; Thu, 16 Dec 2004 17:07:32 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 8F1A03B6A19 for ; Thu, 16 Dec 2004 17:07:31 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id iBGH7MZC012899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 16 Dec 2004 10:07:25 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id iBGH7Mcw067742; Thu, 16 Dec 2004 10:07:22 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id iBGH7LWf067741; Thu, 16 Dec 2004 10:07:21 -0700 (MST) (envelope-from mfuhr) Date: Thu, 16 Dec 2004 10:07:21 -0700 From: Michael Fuhr To: Donald Fraser Cc: "[ADMIN]" Subject: Re: Notifications Message-ID: <20041216170721.GA67633@winnie.fuhr.org> References: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/172 X-Sequence-Number: 15758 On Thu, Dec 16, 2004 at 02:20:07PM -0000, Donald Fraser wrote: > I'm having problems receiving NOTIFY messages when outside our local network. Define "problems." What are you doing, what are you expecting to happen, and what actually does happen? Have you tested whether you have the same problems when *inside* the local network? The distinction between inside or outside may be a red herring. > I have dissabled firewall setting but nothing seems to fix the problem. What firewall setting did you disable and why? Best not to mess around with things unless you have reason to think they'll work (in other words, avoid using a stab-in-the-dark approach). > I was wandering if NOTIFY messages use UDP or TCP, as that would > possibly explain why they are not arriving? PostgreSQL's NOTIFY messages ride inside your connection to the database, so if you're connected across a network then they'll be TCP. But you shouldn't have to do anything special to allow them: if you can connect to the database then you'll get notifications. A possible problem is that a firewall or other intermediate device times out idle connections. Do you notice the problem after periods of no activity? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ From tgl@sss.pgh.pa.us Thu Dec 16 17:27:35 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F10BD3B6884 for ; Thu, 16 Dec 2004 17:27:35 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62120-07 for ; Thu, 16 Dec 2004 17:27:27 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0E5123B67B5 for ; Thu, 16 Dec 2004 17:27:27 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id iBGHRPsk025967; Thu, 16 Dec 2004 12:27:25 -0500 (EST) To: "Donald Fraser" Cc: "[ADMIN]" Subject: Re: Notifications In-reply-to: <002801c4e390$d6633c40$6464a8c0@DonAcer> References: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> <25438.1103215307@sss.pgh.pa.us> <002801c4e390$d6633c40$6464a8c0@DonAcer> Comments: In-reply-to "Donald Fraser" message dated "Thu, 16 Dec 2004 17:01:04 +0000" Date: Thu, 16 Dec 2004 12:27:25 -0500 Message-ID: <25966.1103218045@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/176 X-Sequence-Number: 15762 "Donald Fraser" writes: > Could there be some sort of problem with SSL ? No, I don't believe that one either. As Michael Fuhr says, you need to be a lot more specific about what problem you are seeing. regards, tom lane From postgres@kiwi-fraser.net Thu Dec 16 17:44:22 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 61E743B6AE2 for ; Thu, 16 Dec 2004 17:44:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92003-10 for ; Thu, 16 Dec 2004 17:44:18 +0000 (GMT) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by svr1.postgresql.org (Postfix) with ESMTP id D3ED23B6D3E for ; Thu, 16 Dec 2004 17:44:17 +0000 (GMT) Received: from DonAcer (unknown [84.12.26.148]) by smtp.nildram.co.uk (Postfix) with SMTP id D7A9B250273 for ; Thu, 16 Dec 2004 17:44:13 +0000 (GMT) Message-ID: <003701c4e396$d9b4a270$6464a8c0@DonAcer> From: "Donald Fraser" To: "[ADMIN]" References: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> <20041216170721.GA67633@winnie.fuhr.org> Subject: Re: Notifications Date: Thu, 16 Dec 2004 17:44:09 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/177 X-Sequence-Number: 15763 ----- Original Message ----- From: "Michael Fuhr" Sent: Thursday, December 16, 2004 5:07 PM Subject: Re: [ADMIN] Notifications > On Thu, Dec 16, 2004 at 02:20:07PM -0000, Donald Fraser wrote: > >> I'm having problems receiving NOTIFY messages when outside our local >> network. > > Define "problems." What are you doing, what are you expecting to > happen, and what actually does happen? Have you tested whether you > have the same problems when *inside* the local network? The > distinction between inside or outside may be a red herring. Ok the problem is that outside our local network, and more precise on the outside of our firewall, users do not receive NOTIFY messages. The exact same software running on the local network, albeit not using SSL does receive NOTIFY messages. >> I have dissabled firewall setting but nothing seems to fix the problem. > > What firewall setting did you disable and why? Best not to mess > around with things unless you have reason to think they'll work > (in other words, avoid using a stab-in-the-dark approach). I didn't change anything on our corporate firewall - it has tunnels through so that we can connect to the database, what I was disabling was the microsoft firewall on a PC connected to the database. >> I was wandering if NOTIFY messages use UDP or TCP, as that would >> possibly explain why they are not arriving? > > PostgreSQL's NOTIFY messages ride inside your connection to the > database, so if you're connected across a network then they'll be > TCP. But you shouldn't have to do anything special to allow them: > if you can connect to the database then you'll get notifications. > > A possible problem is that a firewall or other intermediate device > times out idle connections. Do you notice the problem after periods > of no activity? The problem is immediate, I can instanciate the sending of a NOTIFY message from my own connection and I don't receive a return message yet users on the local network do. Basically now that I know NOTIFY uses TCP and therefore "should" clearly not be getting lost anywhere, I will do a lot more investigating into our software as that is the most likely place for the proble!. It just seems a bit strange that the same software can receive messages when on the local network... The one thing I can be sure of is that it will be software! I think the clue must be the setting up of SSL on our software.... Thanks for the input, regards Donald Fraser. > -- > Michael Fuhr > http://www.fuhr.org/~mfuhr/ > From mike@fuhr.org Thu Dec 16 18:54:46 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 970453B7781 for ; Thu, 16 Dec 2004 18:54:46 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 89974-10 for ; Thu, 16 Dec 2004 18:54:35 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 6FF103C9455 for ; Thu, 16 Dec 2004 18:54:34 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id iBGIsRfv012983 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 16 Dec 2004 11:54:30 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id iBGIsRv7002187; Thu, 16 Dec 2004 11:54:27 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id iBGIsQmt002186; Thu, 16 Dec 2004 11:54:26 -0700 (MST) (envelope-from mfuhr) Date: Thu, 16 Dec 2004 11:54:26 -0700 From: Michael Fuhr To: Donald Fraser Cc: "[ADMIN]" Subject: Re: Notifications Message-ID: <20041216185426.GA80816@winnie.fuhr.org> References: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> <20041216170721.GA67633@winnie.fuhr.org> <003701c4e396$d9b4a270$6464a8c0@DonAcer> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003701c4e396$d9b4a270$6464a8c0@DonAcer> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/185 X-Sequence-Number: 15771 On Thu, Dec 16, 2004 at 05:44:09PM -0000, Donald Fraser wrote: > > Ok the problem is that outside our local network, and more precise on the > outside of our firewall, users do not receive NOTIFY messages. The exact > same software running on the local network, albeit not using SSL does > receive NOTIFY messages. As with the inside-vs-outside issue, SSL might be a red herring. It's curious that the same software behaves differently in different locations, but be careful not to use tunnel vision when investigating the cause. Is there *anything* else that's different between the systems whose connections work and those whose don't? Is it possible that the outside users are connecting to a different database server than the inside users? What OS are you using, what language, what database interface? How are you checking for NOTIFY messages? > The problem is immediate, I can instanciate the sending of a NOTIFY message > from my own connection and I don't receive a return message yet users on > the local network do. Have you done simple tests with psql? You'd probably have to issue a query before seeing the notification, but that should still tell you if the notification arrived at all. > Basically now that I know NOTIFY uses TCP and therefore "should" clearly > not be getting lost anywhere, I will do a lot more investigating into our > software as that is the most likely place for the proble!. It just seems a > bit strange that the same software can receive messages when on the local > network... The one thing I can be sure of is that it will be software! I > think the clue must be the setting up of SSL on our software.... Again, beware of putting on blinders. If the database connection is otherwise working then it would be strange if SSL configuration were causing the problem. *Is* the connection otherwise working? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ From postgres@kiwi-fraser.net Fri Dec 17 13:01:46 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 79C613CC32B for ; Fri, 17 Dec 2004 13:01:46 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50830-06 for ; Fri, 17 Dec 2004 13:01:36 +0000 (GMT) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by svr1.postgresql.org (Postfix) with ESMTP id B9CA13CC97E for ; Fri, 17 Dec 2004 13:01:36 +0000 (GMT) Received: from DonAcer (unknown [84.12.26.148]) by smtp.nildram.co.uk (Postfix) with SMTP id 08044276CBD for ; Fri, 17 Dec 2004 13:01:34 +0000 (GMT) Message-ID: <003301c4e438$8a304fe0$6464a8c0@DonAcer> From: "Donald Fraser" To: "[ADMIN]" References: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> <20041216170721.GA67633@winnie.fuhr.org> <003701c4e396$d9b4a270$6464a8c0@DonAcer> <20041216185426.GA80816@winnie.fuhr.org> Subject: Re: Notifications Date: Fri, 17 Dec 2004 13:01:34 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/194 X-Sequence-Number: 15780 Hello again, I had to rush off to a Christmas meal last night, hence the late reply.... Well today I looked extensively into the problem and discovered that the NOTIFY messages are arriving outside the firewall. I used psql which itself connected to the database with ssl and received its own NOTIFY messages ok . Looking at our software, which is java, the problem lies in the implementation of receiving NOTIFY messages. It uses a separate thread to check the input stream of the socket for incoming data. The problem is related to ssl, the ssl input stream (implemented by sun) does not appear to implement the "available()" method, or at least that is what I'm seeing. According to the documentation the default implementation always returns 0, where as the non-ssl input stream definitely does implement the "available()" method which returns the number of bytes that can be read from the input stream without blocking. According to sun subclasses of InputStream should implemet the "available()" method. Why didn't they just make it an abstract method forcing an implementation - now our code is broken because of it! This will not be an easy work around.... Thanks again for the input, regards Donald Fraser ----- Original Message ----- From: "Michael Fuhr" To: "Donald Fraser" Cc: "[ADMIN]" Sent: Thursday, December 16, 2004 6:54 PM Subject: Re: [ADMIN] Notifications > On Thu, Dec 16, 2004 at 05:44:09PM -0000, Donald Fraser wrote: >> >> Ok the problem is that outside our local network, and more precise on the >> outside of our firewall, users do not receive NOTIFY messages. The exact >> same software running on the local network, albeit not using SSL does >> receive NOTIFY messages. > > As with the inside-vs-outside issue, SSL might be a red herring. > It's curious that the same software behaves differently in different > locations, but be careful not to use tunnel vision when investigating > the cause. > > Is there *anything* else that's different between the systems whose > connections work and those whose don't? > > Is it possible that the outside users are connecting to a different > database server than the inside users? > > What OS are you using, what language, what database interface? How > are you checking for NOTIFY messages? > >> The problem is immediate, I can instanciate the sending of a NOTIFY message >> from my own connection and I don't receive a return message yet users on >> the local network do. > > Have you done simple tests with psql? You'd probably have to issue > a query before seeing the notification, but that should still tell > you if the notification arrived at all. > >> Basically now that I know NOTIFY uses TCP and therefore "should" clearly >> not be getting lost anywhere, I will do a lot more investigating into our >> software as that is the most likely place for the proble!. It just seems a >> bit strange that the same software can receive messages when on the local >> network... The one thing I can be sure of is that it will be software! I >> think the clue must be the setting up of SSL on our software.... > > Again, beware of putting on blinders. If the database connection > is otherwise working then it would be strange if SSL configuration > were causing the problem. *Is* the connection otherwise working? > > -- > Michael Fuhr > http://www.fuhr.org/~mfuhr/ > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > From mike@fuhr.org Fri Dec 17 18:23:53 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CBCFC3CC495 for ; Fri, 17 Dec 2004 18:23:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01062-07 for ; Fri, 17 Dec 2004 18:23:42 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 12FC93CCF15 for ; Fri, 17 Dec 2004 18:23:42 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id iBHINZ7u014357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Dec 2004 11:23:38 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id iBHINZw4077640; Fri, 17 Dec 2004 11:23:35 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id iBHINYEZ077639; Fri, 17 Dec 2004 11:23:35 -0700 (MST) (envelope-from mfuhr) Date: Fri, 17 Dec 2004 11:23:34 -0700 From: Michael Fuhr To: Donald Fraser Cc: "[ADMIN]" Subject: Re: Notifications Message-ID: <20041217182334.GA77516@winnie.fuhr.org> References: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> <20041216170721.GA67633@winnie.fuhr.org> <003701c4e396$d9b4a270$6464a8c0@DonAcer> <20041216185426.GA80816@winnie.fuhr.org> <003301c4e438$8a304fe0$6464a8c0@DonAcer> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003301c4e438$8a304fe0$6464a8c0@DonAcer> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200412/196 X-Sequence-Number: 15782 On Fri, Dec 17, 2004 at 01:01:34PM -0000, Donald Fraser wrote: > Looking at our software, which is java, the problem lies in the > implementation of receiving NOTIFY messages. It uses a separate thread to > check the input stream of the socket for incoming data. The problem is Are you just looking for incoming data, or are you also checking that the data indeed contains a notification? > related to ssl, the ssl input stream (implemented by sun) does not appear > to implement the "available()" method, or at least that is what I'm seeing. > According to the documentation the default implementation always returns 0, > where as the non-ssl input stream definitely does implement the > "available()" method which returns the number of bytes that can be read > from the input stream without blocking. According to sun subclasses of > InputStream should implemet the "available()" method. Why didn't they just > make it an abstract method forcing an implementation - now our code is > broken because of it! Do you have another way to check if the underlying socket is readable? In C using libpq you'd get the connection's file descriptor with PQsocket() and then call select() or poll() to wait for it to become readable. Can you do that in Java? Apparently its available() method abstracts those calls and adds some magic of its own -- can you bypass available() and get at the lower-layer functions? I wonder if there would be merit in PostgreSQL providing a server-side function that you could use like this: SELECT * FROM wait_for_notifies(); pid | condition -------+----------- 77578 | test (1 row) This would provide a simple interface for clients that want to block until a notification arrives, one that wouldn't require any special handling by the underlying client library. Thoughts from the developers? Has such a thing been proposed before? Are there implementation issues that would make it difficult or impossible to do? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ From postgres@kiwi-fraser.net Sun Jan 2 00:39:53 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5C7BB3A2997 for ; Sun, 2 Jan 2005 00:39:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63334-09 for ; Sun, 2 Jan 2005 00:39:37 +0000 (GMT) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by svr1.postgresql.org (Postfix) with ESMTP id E1BB13A2950 for ; Sun, 2 Jan 2005 00:39:37 +0000 (GMT) Received: from demolish1 (213-208-104-4.dyn.gotadsl.co.uk [213.208.104.4]) by smtp.nildram.co.uk (Postfix) with SMTP id 1D89824D6C4 for ; Sun, 2 Jan 2005 00:39:33 +0000 (GMT) Message-ID: <000b01c4f063$cb749420$0264a8c0@demolish1> From: "Donald Fraser" To: "[ADMIN]" References: <002e01c4e37a$5ab3bae0$6464a8c0@DonAcer> <20041216170721.GA67633@winnie.fuhr.org> <003701c4e396$d9b4a270$6464a8c0@DonAcer> <20041216185426.GA80816@winnie.fuhr.org> <003301c4e438$8a304fe0$6464a8c0@DonAcer> Subject: Re: Notifications Date: Sun, 2 Jan 2005 00:41:23 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200501/1 X-Sequence-Number: 15860 Just a final follow up to this message thread - Sun Microsystems confirm that there is a bug with their implementation of the ssl input stream socket in the 1.4 series JVM. Regards Donald Fraser ----- Original Message ----- From: "Sun Microsystems" Sent: Friday, December 31, 2004 9:49 PM Subject: Re: (Incident Review ID: 358430) available() method of SSLSocket InputStream not implemented > --- Note: you can send us updates about your Incident --- > --- by replying to this mail. Place new information --- > --- above these lines. Do not include attachments. --- > --- Our system ignores attachments and anything below --- > --- these lines. --- > > Hi Donald Fraser, > > This issue is related to Bug ID: 4072863. Thank you for providing additional information for our investigation. > > You can review this bug and look for related issues on the Java Developer Connection Bug Database at: > http://developer.java.sun.com/developer/bugParade/ > and > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4072863 > > Bug 4072863 seems to be related to this problem, but it does not specifically talk about SSL Sockets. However there is a very good post from wetmore on the forums available at > http://forum.java.sun.com/thread.jspa?forumID=2&threadID=423967 that brings perspective to your problem. > > The problem related to the available method returning 0 has been discussed in various forums. Do check the various discussion threads available in the forums. However if you feel that this does not answer your query, please feel free to submit a new report with any additional information you may have. If you send me the ID of the new incident, I will try to expedite the reporting process. > > Thanks for taking the time to report this problem. > > Regards, > Nelson ----- Original Message ----- From: "Donald Fraser" To: "[ADMIN]" Sent: Friday, December 17, 2004 1:01 PM Subject: Re: [ADMIN] Notifications > Hello again, > I had to rush off to a Christmas meal last night, hence the late reply.... > > Well today I looked extensively into the problem and discovered that the NOTIFY > messages are arriving outside the firewall. > I used psql which itself connected to the database with ssl and received its > own NOTIFY messages ok > . > Looking at our software, which is java, the problem lies in the implementation > of receiving NOTIFY messages. It uses a separate thread to check the input > stream of the socket for incoming data. The problem is related to ssl, the ssl > input stream (implemented by sun) does not appear to implement the > "available()" method, or at least that is what I'm seeing. According to the > documentation the default implementation always returns 0, where as the non-ssl > input stream definitely does implement the "available()" method which returns > the number of bytes that can be read from the input stream without blocking. > According to sun subclasses of InputStream should implemet the "available()" > method. Why didn't they just make it an abstract method forcing an > implementation - now our code is broken because of it! > > This will not be an easy work around.... > > Thanks again for the input, > regards > Donald Fraser