Skip to content

Race condition over build directories can cause the build queue reader to panic #984

Closed as not planned
@jyn514

Description

@jyn514

This is the reason there are currently 86 crates in the queue.

2020/08/19 20:58:02 [INFO] rustwide::cmd: [stderr]     Updating crates.io index
[INFO] rustwide::cmd: [stderr]      Ignored package `git-credential-null v1.0.1` is already installed, use --force to override
thread 'build queue reader' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 39, kind: Other, message: "Directory not empty" }
   0: failure::backtrace::internal::InternalBacktrace::new
   1: failure::backtrace::Backtrace::new
   2: rustwide::workspace::Workspace::purge_all_build_dirs
   3: cratesfyi::docbuilder::rustwide_builder::RustwideBuilder::init
   4: cratesfyi::utils::queue_builder::queue_builder
   5: std::sys_common::backtrace::__rust_begin_short_backtrace
   6: core::ops::function::FnOnce::call_once{{vtable.shim}}
   7: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
      <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/sys/unix/thread.rs:87
   8: start_thread
   9: __clone
', src/utils/daemon.rs:73:13

The error went away after a re-deploy so it's an intermittent failure of some sort. I suspect that the new build queue reader is trying to start a build before the old deploy of the queue finishes its build, so it tries to purge the directory for an ongoing build and panics.

Do we really not have any synchronization for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-adminArea: Administration of the production docs.rs serverA-buildsArea: Building the documentation for a crateC-bugCategory: This is a bugP-highHigh priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions