<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13470</bug_id>
          
          <creation_ts>2019-08-08 13:04:08 +0000</creation_ts>
          <short_desc>Autobuilder NFS loses open deleted files</short_desc>
          <delta_ts>2025-06-17 20:38:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>5</classification_id>
          <classification>Infrastructure</classification>
          <product>AutoBuilder</product>
          <component>autobuilder</component>
          <version>3.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>OBSOLETE</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Michael Halstead">mhalstead</assigned_to>
          <cc>infras.ab.watcher</cc>
    
    <cc>Infras.watcher</cc>
    
    <cc>paulg</cc>
    
    <cc>pidge</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>84604</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-08-08 13:04:08 +0000</bug_when>
    <thetext>If worker A deletes a file which is still being used by worker B, it loses the file rather than it sticking around until its closed.

Documenting this here so we have it recorded somewhere.

pokybuild@debian9-ty-2:/srv/autobuilder/buildhistory/test$ python3 test.py 
[&apos;.nfs000000000e48e34100004463&apos;, &apos;test1.py&apos;, &apos;test.py&apos;]

then once test.py is started, running test1.py:

[pokybuild@centos7-ty-4 test]$ python3 test1.py 
df69a7bdf92bbdffdae594f12d8efc2aa6c11eb40fa46af36a06c4d8e95b7338
Traceback (most recent call last):
  File &quot;test1.py&quot;, line 22, in &lt;module&gt;
    for chunk in iter(lambda: f.read(4096), b&quot;&quot;):
  File &quot;test1.py&quot;, line 22, in &lt;lambda&gt;
    for chunk in iter(lambda: f.read(4096), b&quot;&quot;):
OSError: [Errno 116] Stale file handle

which represents the problem.

[pokybuild@centos7-ty-4 test]$ cat test1.py 
#!/usr/bin/env python3
import subprocess
import time
import os
import hashlib

h = hashlib.sha256()

testdir = &quot;/srv/autobuilder/buildhistory/test&quot;
#subprocess.check_call(&quot;cp /usr/bin/zip %s/zip&quot; % testdir, shell=True)
with open(testdir + &quot;/zip&quot;, &quot;rb&quot;) as f:
    foo = f.read(4096)
    h.update(foo)
    print(h.hexdigest())
    #subprocess.check_call(&quot;rm %s/zip&quot; % testdir, shell=True)
    time.sleep(30)
    foo2 = f.read(4096)
    h.update(foo2)
    time.sleep(5)
    foo3 = f.read(4096)
    h.update(foo3)
    for chunk in iter(lambda: f.read(4096), b&quot;&quot;):
        h.update(chunk)
    print(h.hexdigest())
    foo3 = f.seek(0)
    foo3 = f.read(4096)
    print(str(os.listdir(testdir)))

#!/usr/bin/env python3
import subprocess
import time
import os

testdir = &quot;/srv/autobuilder/buildhistory/test&quot;
subprocess.check_call(&quot;cp /usr/bin/zip %s/zip&quot; % testdir, shell=True)
time.sleep(10)
with open(testdir + &quot;/zip&quot;, &quot;rb&quot;) as f:
    foo = f.read(4096)
    time.sleep(5)
    subprocess.check_call(&quot;rm %s/zip&quot; % testdir, shell=True)
    foo2 = f.read(4096)
    time.sleep(5)
    foo3 = f.read(4096)
    print(str(os.listdir(testdir)))

An example build failure this causes are the WARNING in:

https://autobuilder.yoctoproject.org/typhoon/#/builders/53/builds/847

step1b: WARNING: Logfile for failed setscene task is /home/pokybuild/yocto-worker/qemuarm/build/build/tmp/work/x86_64-linux/python3-setuptools-native/41.0.1-r0/temp/log.do_populate_sysroot_setscene.47244
step1b: WARNING: Setscene task (virtual:native:/home/pokybuild/yocto-worker/qemuarm/build/meta/recipes-devtools/python/python3-setuptools_41.0.1.bb:do_populate_sysroot_setscene) failed with exit code &apos;1&apos; - real task will be run instead

where the setscene log would show a stale file handle.

I&apos;d swear the NFS used to keep the file around until all open handles were closed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84611</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-08-08 14:50:42 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=6c7c0cefd34067311144a1d4c01986fe0a4aef26 was added as a workaround on master</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85501</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2019-11-07 20:02:49 +0000</bug_when>
    <thetext>When the file is deleted on the same host with open handles the client renames the file to .nfsXXXXXX and the handle is maintained on that host. Other clients&apos; file handles go stale when the path changes. I don&apos;t think this can be avoided currently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93238</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-05-05 15:26:27 +0000</bug_when>
    <thetext>I wonder if this is something that NFS is even capable of...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96909</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-24 14:24:41 +0000</bug_when>
    <thetext>Bulk move from 4.99 or 0.00 to 5.99</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102282</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2025-06-17 20:38:13 +0000</bug_when>
    <thetext>The valkyrie cluster has not experienced these problems. I don&apos;t think it is due to hardware changes or updates to NFS though. I suspect code changes in the project avoid this problem. This is solved in all currently supported versions of Yocto Project as far as I know.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>