Skip to content

Tar: file changed as we read it #116

@4ilo

Description

@4ilo

Issue

When using tar to create/modify an archive inside a sandboxfs filesystem, sometimes tar will fail with the file changed as we read it error message.

When using sandboxfs this issue is observed regularly but not consistent. Without sandboxfs we never see the issue.

Minimal example

./BUILD
genrule(
    name = "test",
    tools = ["script.sh"],
    outs = ["test.tar"],
    cmd = "$(location script.sh) $@",
)

./script.sh
#!/bin/sh -e

for x in {0..1000}; do
    mkdir -p workdir
    touch workdir/$x.txt
done

tar -C workdir -cf $1 .

for x in {0..100}; do
    rm -rf workdir/*
    tar -C workdir -xf $1 .
    tar -C workdir -cf $1 .
done

Command: bazel clean && bazel build :test --experimental_use_sandboxfs --genrule_strategy=sandboxed --spawn_strategy=sandboxed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions