-
Notifications
You must be signed in to change notification settings - Fork 150
UT[BMQ]: log default allocations #801
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
base: main
Are you sure you want to change the base?
Conversation
if (d_parentCounting_p) { | ||
d_parentCounting_p->onAllocationChange(deltaValue); | ||
} | ||
} |
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.
Moved to MANIPULATORS
54f35d0
to
e493b40
Compare
@@ -1,3 +1,4 @@ | |||
bmqtst_blobtestutil | |||
bmqtst_loggingallocator |
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.
bmqtst
doesn't depend on bmqma
, andI don't want introduce this dependency by placing LoggingAllocator
there
e493b40
to
04c852b
Compare
04c852b
to
15687c5
Compare
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.
Build 2819 of commit 15687c5 has completed with FAILURE
15687c5
to
5a07cb4
Compare
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.
Build 2839 of commit 5a07cb4 has completed with FAILURE
if (d_failFast) { | ||
BSLS_ASSERT_OPT(false && "The allocation was recorded"); | ||
} |
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.
In theory BSLS_ASSERT_OPT is not guaranteed to be enabled in every build, it's probably more appropriate to call std::terminate
here if that's what was intended.
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.
Good point! Alternatively, what about raising an exception?
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.
We cannot raise exceptions in this code by policy. Oddly enough I don't think we document that policy anywhere! But we do not allow exceptions to be thrown in bmq
, mqb
, or bmqbrkr
code.
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.
Currently, any assert statement generates an exception that causes termination of the program if not handled.
libc++abi: terminating due to uncaught exception of type BloombergLP::bsls::AssertTestException
/// @brief Check whether the undesired allocations were recorded and raise | ||
/// an exception if any. | ||
void checkNoAllocations(); |
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.
This doesn't raise an exception if it fails, rather it just ASSERTs. I think it would be better to return !d_failed.load()
and have the caller check for the failure.
5a07cb4
to
f138283
Compare
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.
Build 2870 of commit f138283 has completed with FAILURE
f138283
to
064d39a
Compare
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.
Build 2878 of commit 064d39a has completed with FAILURE
Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
064d39a
to
ffd4530
Compare
Uh oh!
There was an error while loading. Please reload this page.