Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] sstate: Consider .lock suffix for when loading sstate file from mirror
@ 2021-10-31 20:08 Manuel Leonhardt
  2021-10-31 20:13 ` Manuel Leonhardt
  2021-10-31 23:11 ` [OE-core] " Richard Purdie
  0 siblings, 2 replies; 8+ messages in thread
From: Manuel Leonhardt @ 2021-10-31 20:08 UTC (permalink / raw)
  To: openembedded-core; +Cc: Manuel Leonhardt


[-- Attachment #1.1: Type: text/plain, Size: 2735 bytes --]

When using an sstate mirror over HTTP/S, a lockfile is created during
download. Previously, this resulted in an OSError (ENAMETOOLONG) in the
bb.utils.lockfile function because the lockfile has the filename of the
sstate file plus ".lock". Since this case is also not handled properly
in bb.utils.lockfile, this caused populate tasks to hang indefinitely.

Also, previously when generating a shorter filename, the reserved
characters for .siginfo and now .lock were not considered. This is now
fixed by using limit instead of 254, which is the maximum length.

Signed-off-by: Manuel Leonhardt <mleonhardt@arri.de>
---
 meta/classes/sstate.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 6e4eb09f8e..b6a8951f8a 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -14,6 +14,8 @@ def generate_sstatefn(spec, hash, taskname, siginfo, d):
     if siginfo:
         limit = 254
         extension = ".tar.zst.siginfo"
+    # 5 chars reserved for .lock suffix when downloading from sstate mirror
+    limit -= 5
     if not hash:
         hash = "INVALID"
     fn = spec + hash + "_" + taskname + extension
@@ -22,7 +24,7 @@ def generate_sstatefn(spec, hash, taskname, siginfo, d):
         components = spec.split(":")
         # Fields 0,5,6 are mandatory, 1 is most useful, 2,3,4 are just for information
         # 7 is for the separators
-        avail = (254 - len(hash + "_" + taskname + extension) - len(components[0]) - len(components[1]) - len(components[5]) - len(components[6]) - 7) // 3
+        avail = (limit - len(hash + "_" + taskname + extension) - len(components[0]) - len(components[1]) - len(components[5]) - len(components[6]) - 7) // 3
         components[2] = components[2][:avail]
         components[3] = components[3][:avail]
         components[4] = components[4][:avail]
--
2.33.1


_______________________________________________________
Manuel
Leonhardt
Softwareentwickler
​
ARRI
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Herbert-Bayer-Str. 10,
80807
München
www.arri.com

+49 89 3809-1719
MLeonhardt@arri.de

​
Get all the latest information from www.arri.com, Facebook, Twitter, Instagram and YouTube.

Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRA 57918
Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRB 54477
Geschäftsführer: Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger; Markus Zeiler

​

[-- Attachment #1.2: Type: text/html, Size: 11469 bytes --]

[-- Attachment #2: image555154.png --]
[-- Type: image/png, Size: 528 bytes --]

[-- Attachment #3: image650886.png --]
[-- Type: image/png, Size: 824 bytes --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-01 11:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-31 20:08 [PATCH] sstate: Consider .lock suffix for when loading sstate file from mirror Manuel Leonhardt
2021-10-31 20:13 ` Manuel Leonhardt
2021-10-31 23:11 ` [OE-core] " Richard Purdie
2021-11-01 10:47   ` Manuel Leonhardt
2021-11-01 10:52     ` [OE-core] " Richard Purdie
2021-11-01 11:09       ` Manuel Leonhardt
2021-11-01 11:19         ` [OE-core] " Richard Purdie
2021-11-01 11:21           ` Manuel Leonhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox