Skip to content

Files and directories can collide when serving a directory #1014

@tpoliaw

Description

@tpoliaw

With a directory containing a file x.nxs (or x.h5 etc) and a directory named x, the collision prevents the directory being registered and any datasets it contains cause errors. This duplication is common at DLS where the top level nexus file is something like i22-12345.nxs and then all the detector written files for that collection are written to a subdirectory called i22-12345, eg

data_directory
├── i22-12345.nxs
└── i22-12345
    ├── i22-det1-12345.h5
    └── i22-det2-12345.h5

Trying to run tiled serve directory data_directory results in AttributeError: 'NoneType' object has no attribute 'new' (wrapped in several asyncio queue handling errors) and the server become unresponsive before eventually crashing (~3minutes on my machine).

From a first look at it, it appears that the file is registered first as i22-12345, then when the directory is registered it sees the collision and skips it (Multiple files would result in node at '409: /i22-12345 http://127.0.0.1:8000/api/v1/metadata/'. Skipping all.) and then when trying to register the detector file it fails to find the parent node.

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