Skip to content

concoredocker.hpp paths dont match python + retry is broken #349

@avinxshKD

Description

@avinxshKD

Two issues in the docker C++ implementation....

First - path construction is wrong. Python does os.path.join(inpath, str(port), name) which gives /in/1/data but C++ concatenates as inpath + std::to_string(port) + "/" + name which gives /in1/data - missing the slash after inpath. So python nodes and C++ nodes write to completely different directories and can't communicate at all

Second - the retry loop doesn't work. Line ~152 opens the file with std::ifstream infile(file_path), then in the retry loop it calls infile.open(file_path) again. But if you call open() on an already-opened ifstream it just sets failbit and all subsequent reads fail silently. So the retry never actually retries, it just loops 5 times returning empty string then gives up

You can repro #1 by putting a python writer and C++ reader in the same docker graph - reader won't find the files. For #2 just have any file that takes a moment to appear and watch the retry do nothing

Fix would be-

add "/" after inpath in path construction,
either close() the stream before reopening or just make a new ifstream each loop iteration

btw this is on docker desktop/windows but the path issue will break anywhere and the retry thing is just how C++ streams work

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