Skip to content

Incomplete generation when running two fastddsgen in parallel #534

@iamsergio

Description

@iamsergio

Given this folder structure:

.
|-- idl1/
|   `-- HelloWorld.idl
|-- idl2/
|   `-- HelloWorld.idl
`-- repro.sh

Where HelloWorld.idl is:

struct HelloWorld
{
    string text;
};

And repro.sh is:

rm -rf generated1 generated2
mkdir generated1 generated2
fastddsgen -d generated1 idl1/HelloWorld.idl &
fastddsgen -d generated2 idl2/HelloWorld.idl
wait

ls -lh generated1/idl1/HelloWorld.hpp
ls -lh generated2/idl2/HelloWorld.hpp

Running the above repro.sh results in an incomplete idl1/HelloWorld.hpp

-rw-r--r-- 1 ubuntu ubuntu 1.6K Oct 23 10:18 generated1/idl1/HelloWorld.hpp
-rw-r--r-- 1 ubuntu ubuntu 4.4K Oct 23 10:18 generated2/idl2/HelloWorld.hpp

I'm guessing fastddsgen saves some temporary state based on the filename and there's a clash.

This is however surprising from a user perspective, as both input and output absolute paths are different.

Having two IDL files with the same name in unrelated applications isn’t unusual, and CMake might call fastddsgen in parallel

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