Skip to contentSkip to conversation

sstate: inside the threadedpool don't write to the shared localdata

PATCH In review Jose Quaresma 4 participants 5 messages Mar 6, 2022 – Mar 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sstate: inside the threadedpool don't write to the shared localdata

When inside the threadedpool we make a copy of the localdata to avoid some race condition, so we need to use this new localdata2 and stop write the shared localdata.

---
 meta/classes/sstate.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/sstate.bbclass +1 -1
index dc9a2c085b..7aca415159 100644
@@ -988,7 +988,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
 
             localdata2 = bb.data.createCopy(localdata)
             srcuri = "file://" + sstatefile
-            localdata.setVar('SRC_URI', srcuri)
+            localdata2.setVar('SRC_URI', srcuri)
             bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
 
             import traceback
Signature · 1 line
2.35.1
#1 lore raw
Quoted 14 lines · Jose Quaresma

When inside the threadedpool we make a copy of the localdata to avoid some race condition, so we need to use this new localdata2 and stop write the shared localdata.

---
 meta/classes/sstate.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/sstate.bbclass +0 -0
index dc9a2c085b..7aca415159 100644

meta/classes/sstate.bbclass def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, · line 994

Quoted 8 lines
meta/classes/sstate.bbclass +1 -1
@@ -988,7 +988,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
 
             localdata2 = bb.data.createCopy(localdata)
             srcuri = "file://" + sstatefile
-            localdata.setVar('SRC_URI', srcuri)
+            localdata2.setVar('SRC_URI', srcuri)
             bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
 
             import traceback

That looks like a good find and may explain a few things!

Cheers,

Richard

#2 lore raw
In reply to Jose Quaresma

Note, it appears this bug is in honister as well.

Quoted 33 lines · Jose Quaresma

When inside the threadedpool we make a copy of the localdata to avoid some race condition, so we need to use this new localdata2 and stop write the shared localdata.

---
  meta/classes/sstate.bbclass | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/sstate.bbclass +1 -2
index dc9a2c085b..7aca415159 100644
@@ -988,7 +988,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
 
              localdata2 = bb.data.createCopy(localdata)
              srcuri = "file://" + sstatefile
-            localdata.setVar('SRC_URI', srcuri)
+            localdata2.setVar('SRC_URI', srcuri)
              bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
 
              import traceback
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#162790): https://lists.openembedded.org/g/openembedded-core/message/162790
Mute This Topic: https://lists.openembedded.org/mt/89597961/3616948
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

Mark Hatle <[email protected]> escreveu no dia segunda, 7/03/2022 à(s) 16:14:

Quoted 2 lines

Note, it appears this bug is in honister as well.

is already a little old, dunfell needs this fix as well.

jose

Quoted 42 lines · Jose Quaresma

meta/classes/sstate.bbclass def sstate_checkhashes(sq_data, d, siginfo=False,

Quoted 14 lines

When inside the threadedpool we make a copy of the localdata to avoid some race condition, so we need to use this new localdata2 and stop write the shared localdata.

---
  meta/classes/sstate.bbclass | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/sstate.bbclass +0 -0
index dc9a2c085b..7aca415159 100644
@@ -988,7 +988,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False,

currentcount=0, summary=True,

meta/classes/sstate.bbclass def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,

Quoted 13 lines
meta/classes/sstate.bbclass +1 -1
              localdata2 = bb.data.createCopy(localdata)
              srcuri = "file://" + sstatefile
-            localdata.setVar('SRC_URI', srcuri)
+            localdata2.setVar('SRC_URI', srcuri)
              bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
 
              import traceback
 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#162853):
https://lists.openembedded.org/g/openembedded-core/message/162853
Mute This Topic: https://lists.openembedded.org/mt/89597961/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma
#4 lore raw
Quoted 9 lines · Jose Quaresma

Mark Hatle <[email protected]> escreveu no dia segunda, 7/03/2022 à(s) 16:14:

Quoted 2 lines

Note, it appears this bug is in honister as well.

is already a little old, dunfell needs this fix as well.

In my test queue now.

Thanks!

Steve

Quoted 46 lines
Quoted 22 lines · Jose Quaresma
Quoted 21 lines

When inside the threadedpool we make a copy of the localdata to avoid some race condition, so we need to use this new localdata2 and stop write the shared localdata.

---
  meta/classes/sstate.bbclass | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/sstate.bbclass +1 -1
index dc9a2c085b..7aca415159 100644
@@ -988,7 +988,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
 
              localdata2 = bb.data.createCopy(localdata)
              srcuri = "file://" + sstatefile
-            localdata.setVar('SRC_URI', srcuri)
+            localdata2.setVar('SRC_URI', srcuri)
              bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
 
Quoted 9 lines

meta/classes/sstate.bbclass def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, · line 994

Quoted 6 lines
meta/classes/sstate.bbclass +0 -0
              import traceback

--
Best regards,

José Quaresma

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#162856): https://lists.openembedded.org/g/openembedded-core/message/162856
Mute This Topic: https://lists.openembedded.org/mt/89597961/3620601
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-