lib/sstatesig/find_siginfo: raise an error instead of returning None when obtaining mtime
PATCH 1/1 lib/sstatesig/find_siginfo: raise an error instead of returning None when obtaining mtime
Suppressing the error and returning None can result in a delayed failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/6254/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6262/steps/14/logs/stdio
It is not clear why the os.stat() error occurs to begin with (it shouldn't), so rather than adding further workarounds, let's get diagnostics at the source first, so we understand what is going on.
--- meta/lib/oe/sstatesig.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
meta/lib/oe/sstatesig.py +1 -4
@@ -357,10 +357,7 @@ def find_siginfo(pn, taskname, taskhashlist, d): return siginfo.rpartition('.')[2] def get_time(fullpath): - try: - return os.stat(fullpath).st_mtime - except OSError: - return None + return os.stat(fullpath).st_mtime # First search in stamps dir localdata = d.createCopy()
Signature · 1 line
2.39.2
Quoted 19 lines · Alexander Kanavin
Suppressing the error and returning None can result in a delayed failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/6254/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6262/steps/14/logs/stdioIt is not clear why the
os.stat()error occurs to begin with (it shouldn't), so rather than adding further workarounds, let's get diagnostics at the source first, so we understand what is going on.Signed-off-by Alexander Kanavin <[email protected]>--- meta/lib/oe/sstatesig.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)meta/lib/oe/sstatesig.py +0
-0@@ -357,10 +357,7 @@ def find_siginfo(pn, taskname, taskhashlist, d): return siginfo.rpartition('.')[2]
meta/lib/oe/sstatesig.py def find_siginfo(pn, taskname, taskhashlist, d): · line 363
Quoted 10 lines
meta/lib/oe/sstatesig.py +1
-4def get_time(fullpath): - try: - return os.stat(fullpath).st_mtime - except OSError: - return None + return os.stat(fullpath).st_mtime # First search in stamps dir localdata = d.createCopy()
FWIW, this comes from:
I also suspect it is possible for a file to exist as a temp file but get renamed into place while the test runs.
Cheers,
Richard
Right, I guess the code can be tweaked to not return entries where mtime could not be determined, but I'd like to observe the actual failure in the wild first, for the sake of a better commit message.
Alex
Quoted 42 lines · Richard Purdie
Quoted 19 lines · Alexander Kanavin
Suppressing the error and returning None can result in a delayed failure:
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/6254/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6262/steps/14/logs/stdioIt is not clear why the
os.stat()error occurs to begin with (it shouldn't), so rather than adding further workarounds, let's get diagnostics at the source first, so we understand what is going on.Signed-off-by Alexander Kanavin <[email protected]>--- meta/lib/oe/sstatesig.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)meta/lib/oe/sstatesig.py +0
-0@@ -357,10 +357,7 @@ def find_siginfo(pn, taskname, taskhashlist, d): return siginfo.rpartition('.')[2]meta/lib/oe/sstatesig.py def find_siginfo(pn, taskname, taskhashlist, d): · line 363
Quoted 10 lines
meta/lib/oe/sstatesig.py +1
-4def get_time(fullpath): - try: - return os.stat(fullpath).st_mtime - except OSError: - return None + return os.stat(fullpath).st_mtime # First search in stamps dir localdata = d.createCopy()FWIW, this comes from:
I also suspect it is possible for a file to exist as a temp file but get renamed into place while the test runs.
Cheers,
Richard