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


Groups > comp.lang.python > #74647 > unrolled thread

Blocked thread

Started byLarry Martell <larry.martell@gmail.com>
First post2014-07-17 12:26 -0400
Last post2014-07-17 12:26 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#74647 — Blocked thread

FromLarry Martell <larry.martell@gmail.com>
Date2014-07-17 12:26 -0400
SubjectBlocked thread
Message-ID<mailman.11931.1405614416.18130.python-list@python.org>
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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web