public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/
Date: Tue,  2 Sep 2014 23:10:28 +0000 (UTC)	[thread overview]
Message-ID: <1409699282.d1a47aaeeaa9622eaec08d850d6493313910b9e0.dol-sen@gentoo> (raw)

commit:     d1a47aaeeaa9622eaec08d850d6493313910b9e0
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 22 08:34:41 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep  2 23:08:02 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=d1a47aae

FIXME! Comment out a small code block causing TypeError.

This was also short circuiting another large code block.  FIXME!!!! This
whole class seems overly complicated with TOO MANY nested try:excepts:

---
 catalyst/lock.py | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/catalyst/lock.py b/catalyst/lock.py
index 78968cb..c90f5b8 100644
--- a/catalyst/lock.py
+++ b/catalyst/lock.py
@@ -27,11 +27,17 @@ class LockDir:
 	locking_method=fcntl.flock
 	lock_dirs_in_use=[]
 	die_on_failed_lock=True
+
 	def __del__(self):
+		#print "Lock.__del__() 1"
 		self.clean_my_hardlocks()
+		#print "Lock.__del__() 2"
 		self.delete_lock_from_path_list()
+		#print "Lock.__del__() 3"
 		if self.islocked():
+			#print "Lock.__del__() 4"
 			self.fcntl_unlock()
+		#print "Lock.__del__() finnished"
 
 	def __init__(self,lockdir):
 		self.locked=False
@@ -179,7 +185,9 @@ class LockDir:
 		unlinkfile = 1
 		if not os.path.exists(self.lockfile):
 			print "lockfile does not exist '%s'" % self.lockfile
+			#print "fcntl_unlock() , self.myfd:", self.myfd, type(self.myfd)
 			if (self.myfd != None):
+				#print "fcntl_unlock() trying to close it "
 				try:
 					os.close(self.myfd)
 					self.myfd=None
@@ -193,11 +201,13 @@ class LockDir:
 					unlinkfile = 1
 					self.locking_method(self.myfd,fcntl.LOCK_UN)
 			except SystemExit, e:
-				raise
+				raise e
 			except Exception, e:
-				os.close(self.myfd)
-				self.myfd=None
-				raise IOError, "Failed to unlock file '%s'\n" % self.lockfile
+				#if self.myfd is not None:
+					#print "fcntl_unlock() trying to close", self.myfd
+					#os.close(self.myfd)
+					#self.myfd=None
+				#raise IOError, "Failed to unlock file '%s'\n%s" % (self.lockfile, str(e))
 				try:
 					# This sleep call was added to allow other processes that are
 					# waiting for a lock to be able to grab it before it is deleted.
@@ -224,7 +234,7 @@ class LockDir:
 #						if "DEBUG" in self.settings:
 #							print "Unlinked lockfile..."
 				except SystemExit, e:
-					raise
+					raise e
 				except Exception, e:
 					# We really don't care... Someone else has the lock.
 					# So it is their problem now.
@@ -236,7 +246,7 @@ class LockDir:
 					# open fd closed automatically on them.
 					#if type(lockfilename) == types.StringType:
 					#        os.close(myfd)
-
+		#print "fcntl_unlock() trying a last ditch close", self.myfd
 		if (self.myfd != None):
 			os.close(self.myfd)
 			self.myfd=None
@@ -421,6 +431,7 @@ class LockDir:
 						pass
 		return results
 
+
 if __name__ == "__main__":
 
 	def lock_work():


             reply	other threads:[~2014-09-02 23:10 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 23:10 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-11-22 15:52 [gentoo-commits] proj/catalyst:pending commit in: catalyst/ Brian Dolbec
2017-03-16 22:57 Brian Dolbec
2017-03-16 22:57 Brian Dolbec
2017-03-11  9:35 Brian Dolbec
2017-03-11  7:07 Brian Dolbec
2017-03-10 18:38 Brian Dolbec
2017-03-09 10:02 Brian Dolbec
2017-03-09  9:39 Brian Dolbec
2015-11-21  1:33 Brian Dolbec
2015-11-21  1:33 Brian Dolbec
2015-11-21  1:33 Brian Dolbec
2015-11-21  1:33 Brian Dolbec
2015-11-21  1:33 Brian Dolbec
2015-11-21  1:33 Brian Dolbec
2015-09-08 14:14 Brian Dolbec
2015-09-06 21:21 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-09-06 21:18 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-09-06 21:18 Brian Dolbec
2015-09-06 20:33 Brian Dolbec
2015-09-05 16:24 Brian Dolbec
2015-09-04 15:20 Brian Dolbec
2015-09-03 15:14 Brian Dolbec
2015-09-01  5:58 Brian Dolbec
2015-09-01  5:58 Brian Dolbec
2015-09-01  5:58 Brian Dolbec
2015-09-01  5:58 Brian Dolbec
2015-09-01  4:50 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-09-01  5:58 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-08-30 20:58 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-09-01  5:58 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-06-15 20:25 Brian Dolbec
2015-05-24  0:08 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-05-21 23:53 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-02-26 20:44 Brian Dolbec
2015-02-26 20:44 Brian Dolbec
2015-02-26 19:25 Brian Dolbec
2015-02-26  4:12 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2015-01-01  5:59 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2015-01-01  5:59 Brian Dolbec
2015-01-01  5:59 Brian Dolbec
2015-01-01  5:59 Brian Dolbec
2015-01-01  5:59 Brian Dolbec
2015-01-01  5:59 Brian Dolbec
2014-09-11  3:26 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-06-14  5:58 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-09-11  3:26 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-06-14  5:58 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-09-11  3:08 Brian Dolbec
2014-09-11  3:08 Brian Dolbec
2014-09-11  3:08 Brian Dolbec
2014-09-11  3:08 Brian Dolbec
2014-09-11  3:08 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02 23:10 Brian Dolbec
2014-09-02  7:12 Brian Dolbec
2014-09-02  7:12 Brian Dolbec
2014-09-02  7:12 Brian Dolbec
2014-09-02  7:12 Brian Dolbec
2014-09-02  5:54 Brian Dolbec
2014-09-02  5:54 Brian Dolbec
2014-09-02  5:54 Brian Dolbec
2014-09-02  5:54 Brian Dolbec
2014-09-02  5:54 Brian Dolbec
2014-09-02  2:43 Brian Dolbec
2014-09-02  2:43 Brian Dolbec
2014-09-02  2:43 Brian Dolbec
2014-09-02  2:43 Brian Dolbec
2014-09-02  2:43 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-15 14:56 Brian Dolbec
2014-06-14  5:58 Brian Dolbec
2014-06-14  5:58 Brian Dolbec
2014-06-14  5:58 Brian Dolbec
2014-06-14  5:58 Brian Dolbec
2014-06-14  5:58 Brian Dolbec
2014-06-14  5:58 Brian Dolbec
2014-05-05 19:17 [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-04-02 20:09 ` [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-04-02 20:09 Brian Dolbec
2014-04-02 20:09 Brian Dolbec
2014-04-02 20:09 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec
2014-03-22 22:25 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409699282.d1a47aaeeaa9622eaec08d850d6493313910b9e0.dol-sen@gentoo \
    --to=brian.dolbec@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox