Skip to contentSkip to conversation

Fix infinite loop while trying to lock file on name too long error

PATCH New cpriouzeau 1 participant 1 message Apr 17, 2020

lore
Share & tools
lore

cpriouzeau

author
#0 lore raw

PATCH 1/1 Fix infinite loop while trying to lock file on name too long error

During a call of lockfile the open go on error and generate an infinite
loop of bitbake.

open("...._deploy_source_date_epoch.tgz.siginfo.lock", O_RDWR|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = -1 ENAMETOOLONG (File name too long)

---
 lib/bb/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/utils.py +1 -1
index 5f5767c1d..f48a30dea 100644
@@ -494,7 +494,7 @@ def lockfile(name, shared=False, retry=True, block=False):
                     return lf
             lf.close()
         except OSError as e:
-            if e.errno == errno.EACCES:
+            if e.errno == errno.EACCES or e.errno == errno.ENAMETOOLONG:
                 logger.error("Unable to acquire lock '%s', %s",
                              e.strerror, name)
                 sys.exit(1)
Signature · 1 line
2.17.1