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 A7DD611F61E1 for ; Fri, 7 Apr 2006 02:11:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12442-05 for ; Fri, 7 Apr 2006 02:11:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lvs2.netcore.co.in (lvs2.netcore.co.in [202.162.240.2]) by postgresql.org (Postfix) with ESMTP id 9F05511F6106 for ; Fri, 7 Apr 2006 02:11:21 -0300 (ADT) Received: from uucp3.netcore.co.in (uucp3.netcore.co.in [202.162.229.13]) by lvs2.netcore.co.in (Postfix) with ESMTP id 3CA34B7D3A; Fri, 7 Apr 2006 10:41:20 +0530 (IST) Received: from uucp1.netcore.co.in (unknown [192.168.2.1]) by uucp3.netcore.co.in (Postfix) with ESMTP id 967133B8A2; Fri, 7 Apr 2006 10:41:19 +0530 (IST) Received: by uucp1.netcore.co.in (Postfix, from userid 10) id 305A9174E; Fri, 7 Apr 2006 10:41:20 +0530 (IST) Received: from pavan.psmw (unknown [192.168.70.1]) by ho.netcore.co.in (Postfix) with ESMTP id 7FC23834019; Fri, 7 Apr 2006 10:55:29 +0530 (IST) Subject: Re: thread hang on execute call From: Pavan Kumar To: Dave Cramer Cc: Oliver Jowett , =?ISO-8859-1?Q?Jo=E3o?= Paulo Ribeiro , pgsql-jdbc@postgresql.org In-Reply-To: <8E73BF65-87AA-4DCA-8FF2-1170101928DE@fastcrypt.com> References: <1144141469.16392.18.camel@pavan.psmw> <13631ECC-A37D-4A7E-A730-6CE9670724A4@fastcrypt.com> <18448.1144158004@sss.pgh.pa.us> <1144323083.26830.53.camel@pavan.psmw> <44350696.6030506@mobicomp.com> <44353BD2.7060108@opencloud.com> <2E5000CC-3E4B-4EC5-B26C-2A6CB989971E@fastcrypt.com> <4435842C.3000909@opencloud.com> <8E73BF65-87AA-4DCA-8FF2-1170101928DE@fastcrypt.com> Content-Type: multipart/mixed; boundary="=-bssinY3xX4E9MqaOkYoa" Date: Fri, 07 Apr 2006 10:37:18 +0530 Message-Id: <1144386438.17761.30.camel@pavan.psmw> Mime-Version: 1.0 X-Mailer: Evolution 2.4.0 X-MailServ-MailFilter-MailScanner-Information: Please contact the ISP for more information X-MailServ-MailFilter-MailScanner: Found to be clean X-MailScanner-From: pavan@netcore.co.in X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200604/67 X-Sequence-Number: 15001 --=-bssinY3xX4E9MqaOkYoa Content-Type: text/plain Content-Transfer-Encoding: 7bit hi i sending procedure as attachments that is called by java program. please get it from attachments. i creates 15 worker threads and there is queue for job. worker threads get job from queue if it there and do some db operation. and wait if there is no job in queue. there is another thread that push job in queue. since whole processing takes time.....so worker threads always find job in queue. so they run nonstop and make db call to this procedure. after around 2 days all threads get stuck one bye one. then there is no response from either side. worker thread also do some memory intensive operation at their side. it could be that threads are running low on memory so then might not be able to respond postgres process. but jvm doesn't show out of memory. and both end are waiting on recv call. please tell me if you need more info or the way i should try to help you people to diagnose problem. Following two line or from logs LOG: unexpected EOF on client connection LOG: could not receive data from client: Connection reset by peer well i am not sure when this loggin happened. either after when i killed java process or before it. thanks a lot for your nice help. On Thu, 2006-04-06 at 18:35 -0400, Dave Cramer wrote: > You're correct it's a guess at this point predicated on the > assumption that it works for many others without this flaw. > On 6-Apr-06, at 5:12 PM, Oliver Jowett wrote: > > > Dave Cramer wrote: > >> This is most certainly a threading issue. The question is now > >> whether it is in the driver or outside the driver. > > > > Huh? What made you conclude it was definitely a threading issue? > > > > -O > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 5: don't forget to increase your free space map settings > > > ------------------------------------------------------------------------ Netcore Solutions Pvt. Ltd. Website: http://www.netcore.co.in Spamtraps: http://cleanmail.netcore.co.in/directory.html Support FAQ : http://support.netcore.co.in/ This e-mail contains confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure, use or distribution of the material in this e-mail is strictly forbidden. ------------------------------------------------------------------------ --=-bssinY3xX4E9MqaOkYoa Content-Disposition: attachment; filename=sp_addupdateitem.sql Content-Type: text/x-sql; name=sp_addupdateitem.sql; charset=utf-8 Content-Transfer-Encoding: 7bit CREATE OR REPLACE FUNCTION addupdateitems(items varchar[][], feed_resource_id integer, feed1_title varchar, feed1_url varchar, feed_description varchar, feed_published_date timestamp, feed_encoding varchar, feed_version varchar) RETURNS INTEGER[] AS $$ declare i integer=1; -- CAUTION: itemid might overflow (after an insane amount of time.. ) action integer[]; resid integer; itemid integer; --action integer; --hash_code integer; --new_hash_code integer; publishdate timestamp; lastupdatedate timestamp; lastupdated timestamp; new_title varchar; new_description varchar; feedurl varchar; feedtitle varchar; feeddescription varchar; new_author varchar; result varchar[]; begin --feedurl = decode(items[i][8],'base64'); feedurl = replace(feed1_url,'"','"'); --feedtitle = decode(items[i][9],'base64'); feedtitle = replace(feed1_title,'"','"'); feeddescription = replace(feed_description,'"','"'); IF NOT isUrlExist(feedurl) THEN BEGIN --raise notice '%',feed_resource_id; insert into feed (resource_id,title,url,description,publish_date,encoding,rss_version) values (feed_resource_id,feedtitle,feedurl,feed_description,feed_published_date,feed_encoding,feed_version); --addfeed(resource_id,feed_title,feed_url,feed_description,feed_publish_date,feed_last_update_date); EXCEPTION WHEN unique_violation THEN RAISE EXCEPTION 'Unique key violation for resid % and url %' , feed_resource_id, feedurl; --result[i] = 'unique_violation'; WHEN not_null_violation THEN --result[i] = 'not_null_violation'; WHEN restrict_violation THEN --result[i] = 'restrict_violation'; WHEN check_violation THEN --result[i] = 'check_violation'; END; END IF; --raise notice '%',items[i][1]; WHILE NOT items[i][1] IS NULL LOOP BEGIN resid = feed_resource_id;--items[i][1]; --new_hash_code = items[i][10]; publishdate = items[i][4]; lastupdatedate = items[i][6]; --new_title = decode(items[i][2],'base64'); new_title = replace(items[i][1],'"','"'); --new_description = decode(items[i][4],'base64'); new_description = replace(items[i][3],'"','"'); new_author = replace(items[i][5],'"','"'); EXCEPTION WHEN syntax_error THEN result[i] = 'Error In data Assignment'; END; BEGIN SELECT INTO itemid,lastupdated item_id,last_update_date FROM feeditem WHERE url = items[i][2] AND title = new_title; IF NOT FOUND THEN action[i] := -1; raise notice 'inserting item for url %',items[i][2]; insert into feeditem values (nextval('feeditem_item_id_seq'), resid, new_title, items[i][2], new_description, publishdate, new_author, lastupdatedate); --feedurl, --feedtitle); i=i+1; CONTINUE; END IF; IF NOT lastupdatedate IS NULL AND lastupdatedate > lastupdated THEN raise notice 'updating item for item id %',itemid; action[i] := itemid; update feeditem set resource_id = resid , title = new_title , url = items[i][2] , description = new_description , publish_date = publishdate , author = new_author, last_update_date = lastupdatedate --feed_url = feedurl , --feed_title = feedtitle where item_id = itemid ; i=i+1; CONTINUE; END IF; action[i] := 0; i=i+1; raise notice 'nothing'; EXCEPTION WHEN unique_violation THEN result[i] = 'unique_violation'; WHEN not_null_violation THEN result[i] = 'not_null_violation'; WHEN restrict_violation THEN result[i] = 'restrict_violation'; WHEN check_violation THEN result[i] = 'check_violation'; END; END LOOP; return action; END; $$ LANGUAGE 'plpgsql' VOLATILE; --=-bssinY3xX4E9MqaOkYoa--