szaszm commented on a change in pull request #1107:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1107#discussion_r676527858
##########
File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp
##########
@@ -332,7 +334,6 @@ void ConsumeWindowsEventLog::onSchedule(const
std::shared_ptr<core::ProcessConte
bool ConsumeWindowsEventLog::commitAndSaveBookmark(const std::wstring
&bookmark_xml, const std::shared_ptr<core::ProcessSession> &session) {
{
const TimeDiff time_diff;
- session->commit();
Review comment:
Without this call, the whole function loses it's purpose. We should
remove it. I assume we no longer need to benchmark commit times as they should
be fast with recent improvements.
##########
File path: extensions/windows-event-log/tests/BookmarkTests.cpp
##########
@@ -40,7 +40,10 @@ std::unique_ptr<Bookmark> createBookmark(TestPlan &test_plan,
const utils::Identifier &uuid =
IdGenerator::getIdGenerator()->generate()) {
const auto state_manager =
test_plan.getStateManagerProvider()->getCoreComponentStateManager(uuid);
const auto logger = test_plan.getLogger();
- return utils::make_unique<Bookmark>(channel, L"*", "", uuid, false,
state_manager, logger);
+ state_manager->beginTransaction();
+ auto bookmark = utils::make_unique<Bookmark>(channel, L"*", "", uuid, false,
state_manager, logger);
+ state_manager->commit();
Review comment:
What happens when we forget to create a transaction or forget to commit
outside of onTrigger, where it's implicit?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]