Re: Blocked thread

2014-07-17 Thread Chris Angelico
On Fri, Jul 18, 2014 at 4:50 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> It's more what the client library supports, rather than the server, >> but sure. If it doesn't do async queries, that settles it. > > The server can't control that. At the networking/OS level, it's all > asynchronous.

Re: Blocked thread

2014-07-17 Thread Marko Rauhamaa
Chris Angelico : > It's more what the client library supports, rather than the server, > but sure. If it doesn't do async queries, that settles it. The server can't control that. At the networking/OS level, it's all asynchronous. I would recommend a process pool for blocking DB queries. Marko

Re: Blocked thread

2014-07-17 Thread Chris Angelico
On Fri, Jul 18, 2014 at 4:19 AM, Larry Martell wrote: > I do not think Oracle support async or non-blocking queries as > Postgres does. But what I think I can do is not call join(), and just > start monitoring the server when I kick off the thread with the mail > sql it in. It's more what the cli

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 2:09 PM, Chris Angelico wrote: > On Fri, Jul 18, 2014 at 4:03 AM, Larry Martell > wrote: >> On Thu, Jul 17, 2014 at 2:01 PM, Chris Angelico wrote: >>> On Fri, Jul 18, 2014 at 3:55 AM, Larry Martell >>> wrote: I can have as many connections to the db server as I wa

Re: Blocked thread

2014-07-17 Thread Chris Angelico
On Fri, Jul 18, 2014 at 4:13 AM, Larry Martell wrote: > But every once it a while it takes 2 minutes. It will be hard > to detect that manually. What I was trying to do in my threaded code > was detect when it was taking more than 5 seconds, and then start > monitoring it. Fair enough. In that ca

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 2:04 PM, Chris Angelico wrote: > On Fri, Jul 18, 2014 at 4:00 AM, Larry Martell > wrote: >> I did ask my DBA - he said "Blocking is a normal part of database >> operations. It's only a problem when it's a deadlock, in which case >> the server will detect that, kill one of

Re: Blocked thread

2014-07-17 Thread Chris Angelico
On Fri, Jul 18, 2014 at 4:03 AM, Larry Martell wrote: > On Thu, Jul 17, 2014 at 2:01 PM, Chris Angelico wrote: >> On Fri, Jul 18, 2014 at 3:55 AM, Larry Martell >> wrote: >>> I can have as many connections to the db server as I want, that's not >>> the issue. The issue is that my main thread se

Re: Blocked thread

2014-07-17 Thread Chris Angelico
On Fri, Jul 18, 2014 at 4:00 AM, Larry Martell wrote: > I did ask my DBA - he said "Blocking is a normal part of database > operations. It's only a problem when it's a deadlock, in which case > the server will detect that, kill one of the processes and log it." > > My situation is not a deadlock -

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 2:01 PM, Chris Angelico wrote: > On Fri, Jul 18, 2014 at 3:55 AM, Larry Martell > wrote: >> I can have as many connections to the db server as I want, that's not >> the issue. The issue is that my main thread seems to be blocked in the >> join(), so I guess I'm going to n

Re: Blocked thread

2014-07-17 Thread Chris Angelico
On Fri, Jul 18, 2014 at 3:55 AM, Larry Martell wrote: > I can have as many connections to the db server as I want, that's not > the issue. The issue is that my main thread seems to be blocked in the > join(), so I guess I'm going to need a separate script. I was trying > to avoid that. Right, but

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 1:46 PM, Skip Montanaro wrote: > > On Thu, Jul 17, 2014 at 12:32 PM, Chris Angelico wrote: >> >> I don't know Oracle specifically, but if it's anything like >> PostgreSQL, you'll probably do better with a completely separate >> connection to the server > > > Agreed. We use

Re: Blocked thread

2014-07-17 Thread Larry Martell
On Thu, Jul 17, 2014 at 1:32 PM, Chris Angelico wrote: > On Fri, Jul 18, 2014 at 2:26 AM, Larry Martell > wrote: >> I have a python cx_Oracle script that does a delete from a table. >> Usually this takes well under 1 second. But sometimes it takes 1 to 2 >> minutes. I wanted to monitor that dele

Re: Blocked thread

2014-07-17 Thread Skip Montanaro
On Thu, Jul 17, 2014 at 12:32 PM, Chris Angelico wrote: > I don't know Oracle specifically, but if it's anything like > PostgreSQL, you'll probably do better with a completely separate > connection to the server > Agreed. We use Sybase, and our DBA uses their tools extensively to identify proble

Re: Blocked thread

2014-07-17 Thread Chris Angelico
On Fri, Jul 18, 2014 at 2:26 AM, Larry Martell wrote: > I have a python cx_Oracle script that does a delete from a table. > Usually this takes well under 1 second. But sometimes it takes 1 to 2 > minutes. I wanted to monitor that delete and if it's taking too long I > want to see what is blocking

Blocked thread

2014-07-17 Thread Larry Martell
I have a python cx_Oracle script that does a delete from a table. Usually this takes well under 1 second. But sometimes it takes 1 to 2 minutes. I wanted to monitor that delete and if it's taking too long I want to see what is blocking it. I run the delete sql in a thread and I do this: while sel