Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74647

Blocked thread

Date 2014-07-17 12:26 -0400
Subject Blocked thread
From Larry Martell <larry.martell@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.11931.1405614416.18130.python-list@python.org> (permalink)

Show all headers | View raw


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 self.isAlive():
  self.join(5)
  if self.isAlive():
     # run query to see who is blocking


Looking at the timing on this, at 13:45:11.780 I called join and at
13:46:20.118 I was running the query to check for blocking. That query
does not show that the delete is running and the next time through the
loop isAlive() is False. My WAG is that when the delete query is
blocked the join does not return and I am 'blocked' in the join() -
does that seem like what would happen? It's not what I would expect.
Can anyone think of a better way to do this? I could have a second
script that does it, but that's kinda messy.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Blocked thread Larry Martell <larry.martell@gmail.com> - 2014-07-17 12:26 -0400

csiph-web