Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@

#include <cstdint>
#include <exception>
#include <iostream>
#include <mutex>
#include <optional>
#include <unistd.h>
#include <utility>

namespace score::mw::com::impl::lola
Expand Down Expand Up @@ -392,6 +394,10 @@ auto ServiceDiscoveryClient::HandleEvents(

const auto& events = expected_events.value();

std::stringstream handle_events_log{};
handle_events_log << "Inotify HandleEvents: received " << events.size() << " event(s) / pid=" << ::getpid();
std::cout << handle_events_log.str() << std::endl;

std::vector<os::InotifyEvent> deletion_events{};
std::vector<os::InotifyEvent> creation_events{};
for (const auto& event : events)
Expand All @@ -403,6 +409,18 @@ auto ServiceDiscoveryClient::HandleEvents(
const bool inode_was_removed = search_directory_was_removed || flag_file_was_removed;
const bool inode_was_created = ReadMaskSet(event, os::InotifyEvent::ReadMask::kInCreate);

std::stringstream event_log{};
event_log << "Inotify event"
<< " / pid=" << ::getpid()
<< " / wd=" << event.GetWatchDescriptor().GetUnderlying()
<< " / mask=0x" << std::hex << static_cast<underlying_type_readmask>(event.GetMask()) << std::dec
<< " / name=" << event.GetName().data()
<< " / q_overflow=" << inotify_queue_overflowed
<< " / dir_removed=" << search_directory_was_removed
<< " / flag_removed=" << flag_file_was_removed
<< " / created=" << inode_was_created;
std::cout << event_log.str() << std::endl;

if (inotify_queue_overflowed)
{
mw::log::LogError("lola")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ integration_test(
# To be enabled on qnx once the bug is fixed or
# service discovery is reimplemented to not rely on
# inotify events (SWP-214271).
target_compatible_with = ["@platforms//os:linux"],
# target_compatible_with = ["@platforms//os:linux"],
)
Loading