Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 03CA661AFBD for ; Fri, 20 Jan 2012 10:50:25 -0400 (AST) Received: from mail-bk0-f46.google.com ([209.85.214.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RoFnI-000583-E7 for pgsql-jdbc@postgresql.org; Fri, 20 Jan 2012 14:50:24 +0000 Received: by bkas6 with SMTP id s6so495610bka.19 for ; Fri, 20 Jan 2012 06:50:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=zBCqKO95U8JeuWckSE539nhf8HnSKaFiJ6x00LgGCZI=; b=cZ6xvIlGyuz8GgbNPStkYOrTC+OjDURJKA1KYGQ/lBsC0EH1JribU+m0Y4n2ZyKgWX 8L0jmmwav6M7Ooub9hf0YuQLhPiSWxEKnYZa64GVju5g3c2go6O8QQBQNuJqCyAPz7JY Jmvk7MfUgUnEn/tSWXtoiY4igGP/hE2QUk0MY= Received: by 10.204.154.136 with SMTP id o8mr12275557bkw.112.1327071006482; Fri, 20 Jan 2012 06:50:06 -0800 (PST) Received: from [10.64.1.26] ([94.45.140.16]) by mx.google.com with ESMTPS id iu2sm6784918bkb.0.2012.01.20.06.50.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Jan 2012 06:50:05 -0800 (PST) Message-ID: <4F197F20.6020901@gmail.com> Date: Fri, 20 Jan 2012 16:50:08 +0200 From: Vitalii Tymchyshyn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111109 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: Dave Cramer CC: PG-JDBC Mailing List Subject: Re: NIO support References: <4F19720F.6010008@gmail.com> In-Reply-To: Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201201/65 X-Sequence-Number: 22605 20.01.12 16:06, Dave Cramer написав(ла): > Vitalii, > > Does this compile and run on java 1.4 ? I will check, but it should. NIO was introduced in 1.4 > Thanks for the note on the current bug. > > Dave Cramer > > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca > > > > On Fri, Jan 20, 2012 at 8:54 AM, Vitalii Tymchyshyn wrote: >> Hello. >> >> This patch provides timeouts without additional threads. >> I am going to enhance it to additionally solve next problems (as for me this >> problem are easily solvable with NIO): >> 1) DeadLock when client and server send buffers fill up. This is rare case >> because it requires query to start generation output (e.g. notices) before >> all query data is sent to server. AFAIR this can be provoked by copying to >> table with trigger outputting notices. >> 2) When SSL is enabled, getNotifications does not return notifications until >> server is asked for anything. >> >> Also move to NIO may produce better performance, but this is still something >> to be checked. It may be needed to select carefully if Heap or Off-heap >> buffers should be used to get performance benefit. >> >> P.S. Unrelated to NIO, current setQueryTimeout code has bug since it treats >> timeout as being specified in milliseconds, while javadoc says it's in >> seconds. >> >> 20.01.12 14:05, Dave Cramer написав(ла): >> >>> Can you confirm that this patch is just to add time out ? >>> >>> If not can you outline what problem you are trying to solve ? >>> >>> Dave Cramer >>> >>> dave.cramer(at)credativ(dot)ca >>> http://www.credativ.ca >>> >>> >>> >>> 2012/1/19 В╕тал╕й Тимчишин: >>>> OK, I finally have first try of NIO support in the patch attached. >>>> The only current feature is query timeout without any additional threads. >>>> Please note that current driver has a bug: JDBC specs says timeout is in >>>> seconds and driver takes it as millis, fixed in my patch. >>>> Also current query timeout schema limitation is that query timeout >>>> processing still requires server round trips that are not under timeout >>>> control. I really don't see how much this differ from simply setting >>>> server-side timeout for fast connections. For slow connections it's still >>>> unreliable. Good thing that it is may be possible to enforce some kind of >>>> hard timeout with NIO schema as it's easy to control blocking calls. >>>> Limitations: only for V3 non-secure connections. Other connections use >>>> regular stream-based implementation. >>>> Planned features: >>>> * SSL with NIO. This should allow to receive notifications without >>>> server >>>> roundtrip in SSL mode >>>> * Read answer while sending query. This should make go away the problem >>>> when large query is blocked because answer must be read to send more data >>>> to >>>> server. >>>> >>>> Note that I have never worked with CVS and have problems to make patch >>>> with >>>> new files (AFAICS I can't add it to CVS with RO access). >>>> Comments are welcome. >>>> P.S. To work with SSL I need to start SSL tests. Any hints? >>>> >>>> -- >>>> Best regards, >>>> Vitalii Tymchyshyn >>>> >>>> >>>> -- >>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >>>> To make changes to your subscription: >>>> http://www.postgresql.org/mailpref/pgsql-jdbc >>>>