Fix OTEL metrics write failure in Bazel resmoke shim

XMLWordPrintableJSON

    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      `resmoke_shim.py` creates a short symlink (`/tmp/resmoke_out_<uuid>`) to `TEST_UNDECLARED_OUTPUTS_DIR `. On process exit, Python's `atexit` fires `TracerProvider.shutdown()`, which flushes remaining OTEL spans — but by then `ctx._exit_` has already deleted the symlink, causing `FileNotFoundError` when writing the metrics file.

      Fix: compute `otel_dir` from `undeclared_output_dir` (the real path) instead of the symlink. The underlying directory outlives the symlink, so the `atexit` flush succeeds.

      For context, the short symlink is necessary for Unix domain sockets and some configuration file paths for mongod et. al.

            Assignee:
            Sean Lyons
            Reporter:
            Sean Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: