Thread: thread hang on execute call

thread hang on execute call

From
Pavan Kumar
Date:
Hi
i have some worker threads that perform some database intensive
operation after each fixed interval.so they keeps running.
 after 2 days all threads got hang on execute call on jdbc driver.
there are around 60000 rows in table.
i get no response and following is


here is stack trace of postgres process

#0  0x003437a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00424451 in recv () from /lib/tls/libc.so.6
#2  0x08145aae in secure_read ()
#3  0x0814c062 in pq_recvbuf ()
#4  0x0814c121 in pq_getbyte ()
#5  0x081ad5fc in PostgresMain ()
#6  0x0818765d in ServerLoop ()
#7  0x0818904f in PostmasterMain ()
#8  0x0814dd18 in main ()


and following is stack trace of java thread


Thread 12912: (state = IN_NATIVE)
 - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor,
byte[], int, int, int) @bci=0 (Compiled frame; information may be
imprecise)
 - java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129
(Compiled frame)
 - java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled
frame)
 - java.io.BufferedInputStream.read() @bci=12, line=235 (Compiled frame)
 - org.postgresql.core.PGStream.ReceiveChar() @bci=4, line=254 (Compiled
frame)
 -
org.postgresql.core.v3.QueryExecutorImpl.execute(org.postgresql.core.Query, org.postgresql.core.ParameterList,
org.postgresql.core.ResultHandler,int, int, int) @bci=129, line=188 (Interpreted frame) 
 -
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(org.postgresql.core.Query, org.postgresql.core.ParameterList, int)
@bci=199,line=430 (Interpreted frame) 
 - org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(int)
@bci=14, line=346 (Compiled frame)
 - org.postgresql.jdbc2.AbstractJdbc2Statement.execute() @bci=2,
line=339 (Interpreted frame)
 - org.apache.commons.dbcp.DelegatingPreparedStatement.execute() @bci=8,
line=168 (Interpreted frame)



------------------------------------------------------------------------
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.

------------------------------------------------------------------------


Re: thread hang on execute call

From
Dave Cramer
Date:
Pavan,

Is it possible the query does not return ? Try adding a large
statement timeout to the server.

Dave
On 4-Apr-06, at 5:04 AM, Pavan Kumar wrote:

> Hi
> i have some worker threads that perform some database intensive
> operation after each fixed interval.so they keeps running.
>  after 2 days all threads got hang on execute call on jdbc driver.
> there are around 60000 rows in table.
> i get no response and following is
>
>
> here is stack trace of postgres process
>
> #0  0x003437a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
> #1  0x00424451 in recv () from /lib/tls/libc.so.6
> #2  0x08145aae in secure_read ()
> #3  0x0814c062 in pq_recvbuf ()
> #4  0x0814c121 in pq_getbyte ()
> #5  0x081ad5fc in PostgresMain ()
> #6  0x0818765d in ServerLoop ()
> #7  0x0818904f in PostmasterMain ()
> #8  0x0814dd18 in main ()
>
>
> and following is stack trace of java thread
>
>
> Thread 12912: (state = IN_NATIVE)
>  - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor,
> byte[], int, int, int) @bci=0 (Compiled frame; information may be
> imprecise)
>  - java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129
> (Compiled frame)
>  - java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled
> frame)
>  - java.io.BufferedInputStream.read() @bci=12, line=235 (Compiled
> frame)
>  - org.postgresql.core.PGStream.ReceiveChar() @bci=4, line=254
> (Compiled
> frame)
>  -
> org.postgresql.core.v3.QueryExecutorImpl.execute
> (org.postgresql.core.Query, org.postgresql.core.ParameterList,
> org.postgresql.core.ResultHandler, int, int, int) @bci=129,
> line=188 (Interpreted frame)
>  -
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute
> (org.postgresql.core.Query, org.postgresql.core.ParameterList, int)
> @bci=199, line=430 (Interpreted frame)
>  - org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(int)
> @bci=14, line=346 (Compiled frame)
>  - org.postgresql.jdbc2.AbstractJdbc2Statement.execute() @bci=2,
> line=339 (Interpreted frame)
>  - org.apache.commons.dbcp.DelegatingPreparedStatement.execute()
> @bci=8,
> line=168 (Interpreted frame)
>
>
>
> ----------------------------------------------------------------------
> --
> 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.
>
> ----------------------------------------------------------------------
> --
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>


Re: thread hang on execute call

From
Tom Lane
Date:
Dave Cramer <pg@fastcrypt.com> writes:
> Is it possible the query does not return ? Try adding a large
> statement timeout to the server.

The stack traces say that the client and server are each waiting for
input from the other ... so somebody's confused about something.

            regards, tom lane

Re: thread hang on execute call

From
Dave Cramer
Date:
Pavan,

You cannot share connections across threads without locking. Is it
possible that you are doing this ?

Dave
On 4-Apr-06, at 5:04 AM, Pavan Kumar wrote:

> Hi
> i have some worker threads that perform some database intensive
> operation after each fixed interval.so they keeps running.
>  after 2 days all threads got hang on execute call on jdbc driver.
> there are around 60000 rows in table.
> i get no response and following is
>
>
> here is stack trace of postgres process
>
> #0  0x003437a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
> #1  0x00424451 in recv () from /lib/tls/libc.so.6
> #2  0x08145aae in secure_read ()
> #3  0x0814c062 in pq_recvbuf ()
> #4  0x0814c121 in pq_getbyte ()
> #5  0x081ad5fc in PostgresMain ()
> #6  0x0818765d in ServerLoop ()
> #7  0x0818904f in PostmasterMain ()
> #8  0x0814dd18 in main ()
>
>
> and following is stack trace of java thread
>
>
> Thread 12912: (state = IN_NATIVE)
>  - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor,
> byte[], int, int, int) @bci=0 (Compiled frame; information may be
> imprecise)
>  - java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129
> (Compiled frame)
>  - java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled
> frame)
>  - java.io.BufferedInputStream.read() @bci=12, line=235 (Compiled
> frame)
>  - org.postgresql.core.PGStream.ReceiveChar() @bci=4, line=254
> (Compiled
> frame)
>  -
> org.postgresql.core.v3.QueryExecutorImpl.execute
> (org.postgresql.core.Query, org.postgresql.core.ParameterList,
> org.postgresql.core.ResultHandler, int, int, int) @bci=129,
> line=188 (Interpreted frame)
>  -
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute
> (org.postgresql.core.Query, org.postgresql.core.ParameterList, int)
> @bci=199, line=430 (Interpreted frame)
>  - org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(int)
> @bci=14, line=346 (Compiled frame)
>  - org.postgresql.jdbc2.AbstractJdbc2Statement.execute() @bci=2,
> line=339 (Interpreted frame)
>  - org.apache.commons.dbcp.DelegatingPreparedStatement.execute()
> @bci=8,
> line=168 (Interpreted frame)
>
>
>
> ----------------------------------------------------------------------
> --
> 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.
>
> ----------------------------------------------------------------------
> --
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>


Re: thread hang on execute call

From
Pavan Kumar
Date:
i am using dbcp apache connection pooling.
i don't think it would allocate same connection to two thread until it
is released by the other thread.

by seeing stack trance of postgres and java process
it seems both are waiting for input....i couldn't understand how it
could be possible.

On Tue, 2006-04-04 at 11:14 -0400, Dave Cramer wrote:
> Pavan,
>
> You cannot share connections across threads without locking. Is it
> possible that you are doing this ?
>
> Dave
> On 4-Apr-06, at 5:04 AM, Pavan Kumar wrote:
>
> > Hi
> > i have some worker threads that perform some database intensive
> > operation after each fixed interval.so they keeps running.
> >  after 2 days all threads got hang on execute call on jdbc driver.
> > there are around 60000 rows in table.
> > i get no response and following is
> >
> >
> > here is stack trace of postgres process
> >
> > #0  0x003437a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
> > #1  0x00424451 in recv () from /lib/tls/libc.so.6
> > #2  0x08145aae in secure_read ()
> > #3  0x0814c062 in pq_recvbuf ()
> > #4  0x0814c121 in pq_getbyte ()
> > #5  0x081ad5fc in PostgresMain ()
> > #6  0x0818765d in ServerLoop ()
> > #7  0x0818904f in PostmasterMain ()
> > #8  0x0814dd18 in main ()
> >
> >
> > and following is stack trace of java thread
> >
> >
> > Thread 12912: (state = IN_NATIVE)
> >  - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor,
> > byte[], int, int, int) @bci=0 (Compiled frame; information may be
> > imprecise)
> >  - java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129
> > (Compiled frame)
> >  - java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled
> > frame)
> >  - java.io.BufferedInputStream.read() @bci=12, line=235 (Compiled
> > frame)
> >  - org.postgresql.core.PGStream.ReceiveChar() @bci=4, line=254
> > (Compiled
> > frame)
> >  -
> > org.postgresql.core.v3.QueryExecutorImpl.execute
> > (org.postgresql.core.Query, org.postgresql.core.ParameterList,
> > org.postgresql.core.ResultHandler, int, int, int) @bci=129,
> > line=188 (Interpreted frame)
> >  -
> > org.postgresql.jdbc2.AbstractJdbc2Statement.execute
> > (org.postgresql.core.Query, org.postgresql.core.ParameterList, int)
> > @bci=199, line=430 (Interpreted frame)
> >  - org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(int)
> > @bci=14, line=346 (Compiled frame)
> >  - org.postgresql.jdbc2.AbstractJdbc2Statement.execute() @bci=2,
> > line=339 (Interpreted frame)
> >  - org.apache.commons.dbcp.DelegatingPreparedStatement.execute()
> > @bci=8,
> > line=168 (Interpreted frame)
> >
> >
> >
> > ----------------------------------------------------------------------
> > --
> > 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.
> >
> > ----------------------------------------------------------------------
> > --
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 4: Have you searched our list archives?
> >
> >                http://archives.postgresql.org
> >
>


------------------------------------------------------------------------
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.

------------------------------------------------------------------------


Re: thread hang on execute call

From
Pavan Kumar
Date:
hi
 again i stuck to same problem.
i restarted my program. After 36 hour all thread got stuck with
postgresql call.
both java thread and  postgresql are stuck on recv call....i couldn't
understand whats problem.why did it happen.
threads perform database intensive operation. there more then 60000
record in table.
could you tell me if i need to do any performance tuning things. like
increasing cache size.
each postgresql process taking 21-23 MB of memory.


here is the stack trace of postgresql process.

0  0x003437a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00424451 in recv () from /lib/tls/libc.so.6
#2  0x08145aae in secure_read ()
#3  0x0814c062 in pq_recvbuf ()
#4  0x0814c121 in pq_getbyte ()
#5  0x081ad5fc in PostgresMain ()
#6  0x0818765d in ServerLoop ()
#7  0x0818904f in PostmasterMain ()
#8  0x0814dd18 in main ()





following is the stack trace of one of java thread.

Thread 618: (state = IN_NATIVE)
 - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor,
byte[], int, int, int) @bci=0 (Co
mpiled frame; information may be imprecise)
 - java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129
(Compiled frame)
 - java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled
frame)
 - java.io.BufferedInputStream.read() @bci=12, line=235 (Compiled frame)
 - org.postgresql.core.PGStream.ReceiveChar() @bci=4, line=254 (Compiled
frame)
 -
org.postgresql.core.v3.QueryExecutorImpl.execute(org.postgresql.core.Query, org.postgresql.core.
ParameterList, org.postgresql.core.ResultHandler, int, int, int)
@bci=129, line=188 (Interpreted fr
ame)
 -
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(org.postgresql.core.Query, org.postgresql.co
re.ParameterList, int) @bci=199, line=430 (Interpreted frame)
 - org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(int)
@bci=14, line=346 (Compiled fr
ame)
 - org.postgresql.jdbc2.AbstractJdbc2Statement.execute() @bci=2,
line=339 (Interpreted frame)
 - org.apache.commons.dbcp.DelegatingPreparedStatement.execute() @bci=8,
line=168 (Interpreted fram
e)

On Tue, 2006-04-04 at 09:40 -0400, Tom Lane wrote:
> Dave Cramer <pg@fastcrypt.com> writes:
> > Is it possible the query does not return ? Try adding a large
> > statement timeout to the server.
>
> The stack traces say that the client and server are each waiting for
> input from the other ... so somebody's confused about something.
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org


------------------------------------------------------------------------
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.

------------------------------------------------------------------------


Re: thread hang on execute call

From
Oliver Jowett
Date:
Pavan Kumar wrote:
> hi
>  again i stuck to same problem.
> i restarted my program. After 36 hour all thread got stuck with
> postgresql call.
> both java thread and  postgresql are stuck on recv call....

Unfortunately this still doesn't give us enough information to diagnose
the problem.

Can you reproduce the problem using a single thread?

If so, can you capture output showing the problem with loglevel=2
(append '?loglevel=2' to your JDBC URL) and send it to me offlist?

-O

Re: thread hang on execute call

From
Dave Cramer
Date:
Pavan,

I'd have to see the rest of the code to be helpful here. It certainly
sounds like the driver is getting confused.

Candidly though the driver is used by probably 1000's of people
without this happening, so I'd be hard pressed to believe it was the
driver.

I'm certainly open to being proven wrong though.

Dave
On 6-Apr-06, at 7:31 AM, Pavan Kumar wrote:

> hi
>  again i stuck to same problem.
> i restarted my program. After 36 hour all thread got stuck with
> postgresql call.
> both java thread and  postgresql are stuck on recv call....i couldn't
> understand whats problem.why did it happen.
> threads perform database intensive operation. there more then 60000
> record in table.
> could you tell me if i need to do any performance tuning things. like
> increasing cache size.
> each postgresql process taking 21-23 MB of memory.
>
>
> here is the stack trace of postgresql process.
>
> 0  0x003437a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
> #1  0x00424451 in recv () from /lib/tls/libc.so.6
> #2  0x08145aae in secure_read ()
> #3  0x0814c062 in pq_recvbuf ()
> #4  0x0814c121 in pq_getbyte ()
> #5  0x081ad5fc in PostgresMain ()
> #6  0x0818765d in ServerLoop ()
> #7  0x0818904f in PostmasterMain ()
> #8  0x0814dd18 in main ()
>
>
>
>
>
> following is the stack trace of one of java thread.
>
> Thread 618: (state = IN_NATIVE)
>  - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor,
> byte[], int, int, int) @bci=0 (Co
> mpiled frame; information may be imprecise)
>  - java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129
> (Compiled frame)
>  - java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled
> frame)
>  - java.io.BufferedInputStream.read() @bci=12, line=235 (Compiled
> frame)
>  - org.postgresql.core.PGStream.ReceiveChar() @bci=4, line=254
> (Compiled
> frame)
>  -
> org.postgresql.core.v3.QueryExecutorImpl.execute
> (org.postgresql.core.Query, org.postgresql.core.
> ParameterList, org.postgresql.core.ResultHandler, int, int, int)
> @bci=129, line=188 (Interpreted fr
> ame)
>  -
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute
> (org.postgresql.core.Query, org.postgresql.co
> re.ParameterList, int) @bci=199, line=430 (Interpreted frame)
>  - org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(int)
> @bci=14, line=346 (Compiled fr
> ame)
>  - org.postgresql.jdbc2.AbstractJdbc2Statement.execute() @bci=2,
> line=339 (Interpreted frame)
>  - org.apache.commons.dbcp.DelegatingPreparedStatement.execute()
> @bci=8,
> line=168 (Interpreted fram
> e)
>
> On Tue, 2006-04-04 at 09:40 -0400, Tom Lane wrote:
>> Dave Cramer <pg@fastcrypt.com> writes:
>>> Is it possible the query does not return ? Try adding a large
>>> statement timeout to the server.
>>
>> The stack traces say that the client and server are each waiting for
>> input from the other ... so somebody's confused about something.
>>
>>             regards, tom lane
>>
>> ---------------------------(end of
>> broadcast)---------------------------
>> TIP 4: Have you searched our list archives?
>>
>>                http://archives.postgresql.org
>
>
> ----------------------------------------------------------------------
> --
> 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.
>
> ----------------------------------------------------------------------
> --
>
>


Re: thread hang on execute call

From
João Paulo Ribeiro
Date:
Hi.<br /><br /> I believe your problem is some kind of db lock.<br /><br /> When the thread get stuck, execute this
queryto figure if the problem is db locks:<br /><br /> SELECT pg_class.relname AS table, pg_database.datname AS
database,transaction, pid, mode, granted FROM pg_locks, pg_class, pg_database WHERE pg_locks.relation = pg_class.oid
ANDpg_locks.database = pg_database.oid order by pg_class.relname, pid;<br /><br /> Best regards.<br /> João Paulo
Ribeiro<br/><br /><br /> Pavan Kumar wrote: <blockquote cite="mid1144323083.26830.53.camel@pavan.psmw" type="cite"><pre
wrap="">hiagaini stuck to same problem. 
 
i restarted my program. After 36 hour all thread got stuck with
postgresql call. 
both java thread and  postgresql are stuck on recv call....i couldn't
understand whats problem.why did it happen.
threads perform database intensive operation. there more then 60000
record in table.
could you tell me if i need to do any performance tuning things. like
increasing cache size.
each postgresql process taking 21-23 MB of memory.


here is the stack trace of postgresql process.

0  0x003437a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00424451 in recv () from /lib/tls/libc.so.6
#2  0x08145aae in secure_read ()
#3  0x0814c062 in pq_recvbuf ()
#4  0x0814c121 in pq_getbyte ()
#5  0x081ad5fc in PostgresMain ()
#6  0x0818765d in ServerLoop ()
#7  0x0818904f in PostmasterMain ()
#8  0x0814dd18 in main ()





following is the stack trace of one of java thread. 

Thread 618: (state = IN_NATIVE)- java.net.SocketInputStream.socketRead0(java.io.FileDescriptor,
byte[], int, int, int) @bci=0 (Co
mpiled frame; information may be imprecise)- java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129
(Compiled frame)- java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled
frame)- java.io.BufferedInputStream.read() @bci=12, line=235 (Compiled frame)-
org.postgresql.core.PGStream.ReceiveChar()@bci=4, line=254 (Compiled
 
frame)-
org.postgresql.core.v3.QueryExecutorImpl.execute(org.postgresql.core.Query, org.postgresql.core.
ParameterList, org.postgresql.core.ResultHandler, int, int, int)
@bci=129, line=188 (Interpreted fr
ame)-
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(org.postgresql.core.Query, org.postgresql.co
re.ParameterList, int) @bci=199, line=430 (Interpreted frame)-
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(int)
@bci=14, line=346 (Compiled fr
ame)- org.postgresql.jdbc2.AbstractJdbc2Statement.execute() @bci=2,
line=339 (Interpreted frame)- org.apache.commons.dbcp.DelegatingPreparedStatement.execute() @bci=8,
line=168 (Interpreted fram
e)

On Tue, 2006-04-04 at 09:40 -0400, Tom Lane wrote: </pre><blockquote type="cite"><pre wrap="">Dave Cramer <a
class="moz-txt-link-rfc2396E"href="mailto:pg@fastcrypt.com"><pg@fastcrypt.com></a> writes:   </pre><blockquote
type="cite"><prewrap="">Is it possible the query does not return ? Try adding a large  
 
statement timeout to the server.     </pre></blockquote><pre wrap="">The stack traces say that the client and server
areeach waiting for
 
input from the other ... so somebody's confused about something.
        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
              <a class="moz-txt-link-freetext" href="http://archives.postgresql.org">http://archives.postgresql.org</a>
 </pre></blockquote><pre wrap="">
 

------------------------------------------------------------------------
Netcore Solutions Pvt. Ltd.
Website:  <a class="moz-txt-link-freetext" href="http://www.netcore.co.in">http://www.netcore.co.in</a>
Spamtraps: <a class="moz-txt-link-freetext"
href="http://cleanmail.netcore.co.in/directory.html">http://cleanmail.netcore.co.in/directory.html</a>

Support FAQ : <a class="moz-txt-link-freetext" href="http://support.netcore.co.in/">http://support.netcore.co.in/</a>

This e-mail contains confidential and/or privileged information. If you are not the intended recipient (or have
receivedthis 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.
 

------------------------------------------------------------------------


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
              <a class="moz-txt-link-freetext"
href="http://www.postgresql.org/docs/faq">http://www.postgresql.org/docs/faq</a>

 </pre></blockquote><br /><br /><pre class="moz-signature" cols="72">-- 
João Paulo Ribeiro | Senior Software Engineer
<a class="moz-txt-link-abbreviated" href="mailto:jp@mobicomp.com">jp@mobicomp.com</a>

PHONE: + 351 253 305 250
FAX  : + 351 253 305 250
<a class="moz-txt-link-abbreviated" href="http://www.mobicomp.com">www.mobicomp.com</a>

________________________________________________________________

About Solutions | Wireless World

CONFIDENTIALITY NOTICE: This message, as well as existing attached files, is confidential and intended exclusively for
theindividual(s) named as addressees. If you are not the intended recipient, you are kindly requested not to make any
usewhatsoever of its contents and to proceed to the destruction of the message, thereby notifying the sender.
 
DISCLAIMER: The sender of this message can not ensure the security of its electronic transmission and consequently does
notaccept liability for any fact which may interfere with the integrity of its content.</pre> 

Re: thread hang on execute call

From
Oliver Jowett
Date:
João Paulo Ribeiro wrote:

> I believe your problem is some kind of db lock.

It does not look like a DB lock problem. The server is waiting for data
from the JDBC driver, and vice versa, so it doesn't help at all if a DB
lock gets released.

-O

Re: thread hang on execute call

From
Dave Cramer
Date:
This is most certainly a threading issue. The question is now whether
it is in the driver or outside the driver.

Pavan, it would probably be useful if we knew what your code was
doing. Is it doing inserts, or selects mostly ?

Dave

On 6-Apr-06, at 12:03 PM, Oliver Jowett wrote:

> João Paulo Ribeiro wrote:
>
>> I believe your problem is some kind of db lock.
>
> It does not look like a DB lock problem. The server is waiting for
> data from the JDBC driver, and vice versa, so it doesn't help at
> all if a DB lock gets released.
>
> -O
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org
>


Re: thread hang on execute call

From
Oliver Jowett
Date:
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

Re: thread hang on execute call

From
Dave Cramer
Date:
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
>


Re: thread hang on execute call

From
Pavan Kumar
Date:
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.

------------------------------------------------------------------------


Attachment

Re: thread hang on execute call

From
Dave Cramer
Date:
Pavan,

I'd really like to see the java code. It's important to see how you
are handling the connections, exceptions etc.

Dave
On 7-Apr-06, at 1:07 AM, Pavan Kumar wrote:

> 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.
>
> ----------------------------------------------------------------------
> --
>
> <sp_addupdateitem.sql>


Re: thread hang on execute call

From
Pavan Kumar
Date:
i am using spring framework. so all are wrapped up in spring call
it uses apache dbcp for connection pooling

On Fri, 2006-04-07 at 07:26 -0400, Dave Cramer wrote:
> Pavan,
>
> I'd really like to see the java code. It's important to see how you
> are handling the connections, exceptions etc.
>
> Dave
> On 7-Apr-06, at 1:07 AM, Pavan Kumar wrote:
>
> > 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.
> >
> > ----------------------------------------------------------------------
> > --
> >
> > <sp_addupdateitem.sql>
>
>
> ---------------------------(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.

------------------------------------------------------------------------


Re: thread hang on execute call

From
David Hustace
Date:
Pavan,

> 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.

Did you ever resolve this issue?  I had a similar thread running on
this recently:

http://archives.postgresql.org/pgsql-jdbc/2006-01/msg00124.php

and I haven't any closer on your thread, either.


-David


David Hustace
The OpenNMS Group, Inc.
Main  : +1 919 545 2553   Fax:   +1 503-961-7746
Direct: +1 919 827 1201   Skype: dhustace
Key Fingerprint: 8EC1 F319 2C1D 3197 AAB9  580F FACD 1D19 175E D903



Re: thread hang on execute call

From
Dave Cramer
Date:
David,

Is there any way to simulate this. I'd like to get to the bottom of
it. I re-read your posts, and it appears you are using an old version
of the driver.

Dave
On 17-Apr-06, at 11:48 AM, David Hustace wrote:

> Pavan,
>
>> 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.
>
> Did you ever resolve this issue?  I had a similar thread running on
> this recently:
>
> http://archives.postgresql.org/pgsql-jdbc/2006-01/msg00124.php
>
> and I haven't any closer on your thread, either.
>
>
> -David
>
>
> David Hustace
> The OpenNMS Group, Inc.
> Main  : +1 919 545 2553   Fax:   +1 503-961-7746
> Direct: +1 919 827 1201   Skype: dhustace
> Key Fingerprint: 8EC1 F319 2C1D 3197 AAB9  580F FACD 1D19 175E D903
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org
>


Re: thread hang on execute call

From
Pavan Kumar
Date:
hi
 i had 15 worker threads running and performing xml parsing and then
database operation on hug data(most operation are update). I am not sure
but what i think is that my threads stuck one by one due to
unavailability of memory or some other resources. but i was not able to
get exact problem.

 Then i tried with single thread and it worked well for me.
now i have been testing it with 5 threads and i haven't seen any problem
so far.

Thanks
Pavan Kumar
On Mon, 2006-04-17 at 12:40 -0400, Dave Cramer wrote:
> David,
>
> Is there any way to simulate this. I'd like to get to the bottom of
> it. I re-read your posts, and it appears you are using an old version
> of the driver.
>
> Dave
> On 17-Apr-06, at 11:48 AM, David Hustace wrote:
>
> > Pavan,
> >
> >> 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.
> >
> > Did you ever resolve this issue?  I had a similar thread running on
> > this recently:
> >
> > http://archives.postgresql.org/pgsql-jdbc/2006-01/msg00124.php
> >
> > and I haven't any closer on your thread, either.
> >
> >
> > -David
> >
> >
> > David Hustace
> > The OpenNMS Group, Inc.
> > Main  : +1 919 545 2553   Fax:   +1 503-961-7746
> > Direct: +1 919 827 1201   Skype: dhustace
> > Key Fingerprint: 8EC1 F319 2C1D 3197 AAB9  580F FACD 1D19 175E D903
> >
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 4: Have you searched our list archives?
> >
> >               http://archives.postgresql.org
> >
>


------------------------------------------------------------------------
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.

------------------------------------------------------------------------