-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[test: shm] Add testcase for fast reconnection #1916
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
Responding to @hannemn's comment from here:
I explored a few different options targeting either the unlinking of the shm file or interrupting the file observer. I was unable to find a solution for the later option that didn't involve adding something to So, unless you changed the scheme used for the shm files since v5, trying to use a v6 subscriber with a v5 publisher will have the subscriber try and remove the shm file out from under the publisher as it'll see a 0 refcount. I don't know what your policy is w.r.t compatibility between v5 and v6 (I also haven't tested anything). Regarding checking the validity of the event handle, that prevents you from doing |
Hi @DownerCase, thanks for digging so deep into it. @hannemn also tried interrupting the Memfile Observer, this is another area where it might be worth refactoring / restructuring the code a bit. The current solution, to go back to eCAL 5 behavior, and not to unlink any file until process destruction, also has the benefit that it will work seemlessly with eCAL 5. However, it would be great, if we could just take your testcase and see if this now works with current master. |
986fe0a
to
97ba864
Compare
@KerstinKeller Totally understandable, I've rebased onto master and removed the ref counting changes. I believe the test will pass now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The testcase looks good, I am just wondering about printing to std::cerr
. Does this show up in the test logs?
const eCAL::SDataTypeInformation & /*data_type_info_*/, | ||
const eCAL::SReceiveCallbackData & /*data_*/) { | ||
{ | ||
std::cerr << "Callback received message\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DownerCase why are you printing to cerr here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force of habit mostly, cerr's unbuffered so don't need to pepper std::endl/flush
.
Shows up in the logs all the same: https://github.com/eclipse-ecal/ecal/actions/runs/12952082976/job/36128611552#step:11:805
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am already not so happy with all the tests logging in the unittests (I know we also do have quite a bunch of tests that do it).
I'd prefer if we only see what's the problem on test failures, e.g. you could log to the google test command:
EXPECT_TRUE(data_received) << "Missing data from publisher" ;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, I tried to keep it to a minimum but found the extra messages useful when diagnosing a failure (particularly when finding when internal eCAL debug logs are occurring relative to the test).
As an in-between what about logging via the eCAL logging functionality on the debug4 level (or similar)? So that normally no logs will be visible but they're there when you need to dig into it.
I'll add a descriptive error message to the EXPECT_TRUE
Description
Will eventually track down and resolve an issue with subscribers connecting but not receiving data.
Current status: Test case refined, problem understood (see issue for details).
Related issues
Cherry-pick to