X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 8E2BE11F6260 for ; Tue, 11 Apr 2006 19:44:51 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.12 X-Spam-Level: X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id T1SK4vYeaXIi for ; Tue, 11 Apr 2006 19:44:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 1853611F61DE for ; Tue, 11 Apr 2006 19:44:44 -0300 (ADT) Received: (qmail 32452 invoked from network); 11 Apr 2006 22:44:44 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 11 Apr 2006 22:44:44 -0000 In-Reply-To: <59619.132.206.52.74.1144793175.squirrel@mail.cs.mcgill.ca> References: <59619.132.206.52.74.1144793175.squirrel@mail.cs.mcgill.ca> Mime-Version: 1.0 (Apple Message framework v746.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: FastPath blocked when ERROR is thrown Date: Tue, 11 Apr 2006 18:43:21 -0400 To: Yi Lin X-Mailer: Apple Mail (2.746.3) X-Archive-Number: 200604/83 X-Sequence-Number: 15017 If you managed to kill the backend, then it's likely the C function that did it. In order to debug it you can use gdb Can you call the C function from psql without crashing ? Dave On 11-Apr-06, at 6:06 PM, Yi Lin wrote: > HI > > I used java API FastPath.fastpath(fid, ...) to call a C function > PGfn(conn, fid,...) in the kernal. But if there is an exception (i.e., > ERROR messages is thrown in the backend due to elog(ERROR, ...)), the > FastPath.fastpath(fid, ..) is blocked and never returns. The DB > backend is > also dead. I have to "pkill -9 post" in order to restore > everything. Can > anyone give a clue of what the problems should be? Where should are > the > bugs possibly located? > > The java codes is attached: > > public boolean putWriteSet(java.sql.Connection conn, byte[] writeSet) > throws SQLException > { > Fastpath fp = ((org.postgresql.Connection)conn).getFastpathAPI(); > FastpathArg[] args = new FastpathArg[1]; > args[0] = new FastpathArg(writeSet); > fp.fastpath(2075, false, args); //to apply writeset, > indirectly call > PQfn(conn, 2075, ...) implemented in the kernal in C. > > return true; > } > > I am not the original author of C version PQfn(.,2075,..) so I have no > idea where and how to debug it. I doubt that the blocking is due to > implementation of C part instead of Java part. But I don't know how to > start my debugging. > > thanks in advance! > > ======================================= > Yi Lin > > Ph.D. candidate > School of Computer Science > McGill University > Montreal, Quebec,Canada > URL: http://www.cs.mcgill.ca/~ylin30/ > > \\\ $ /// > @ @ > ======o0o==0==o0o====================== > > > ---------------------------(end of > broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >