Skip to content

Conversation

Copy link

Copilot AI commented Jan 21, 2026

Addresses feedback from #22: the checkWrite loop was checking weak_self.lock() on every iteration, but never using the locked pointer. All operations in the loop use the already-captured peer shared_ptr, and splitBatch is a free function.

Changes:

  • Removed WEAK_SELF from lambda capture list
  • Simplified loop condition to use while (auto message = qtils::optionTake(peer->batch_))
  • Eliminated unnecessary lock overhead on each iteration

Before:

coroSpawn(*io_context_, [WEAK_SELF, peer, peer_id, logger = logger_]() -> Coro<void> {
  // ...
  while (true) {
    auto self = weak_self.lock();  // 'self' never used
    if (not self) break;
    auto message = qtils::optionTake(peer->batch_);
    if (not message) break;
    auto pb_messages = splitBatch(*message);  // free function
    // ... rest of loop
  }
});

After:

coroSpawn(*io_context_, [peer, peer_id, logger = logger_]() -> Coro<void> {
  // ...
  while (auto message = qtils::optionTake(peer->batch_)) {
    auto pb_messages = splitBatch(*message);
    // ... rest of loop
  }
});

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 21, 2026 05:34
Co-authored-by: kamilsa <9370151+kamilsa@users.noreply.github.com>
Co-authored-by: kamilsa <9370151+kamilsa@users.noreply.github.com>
Co-authored-by: kamilsa <9370151+kamilsa@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 21, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.nasm.us
    • Triggering command: /usr/bin/wget wget -q -O nasm.tar.gz REDACTED share/vcpkg/down--64 8.0-941b06f73c.c-o an MakeFiles/zlib.dbash ux/include kg/downloads .o /sha�� /share/vcpkg/buildtrees/zlib/x64--gdwarf-5 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] WIP: Address feedback on 'Gossip logs' pull request Remove unused weak_self check from checkWrite loop Jan 21, 2026
Copilot AI requested a review from kamilsa January 21, 2026 05:45
@kamilsa kamilsa closed this Jan 21, 2026
@kamilsa kamilsa deleted the copilot/sub-pr-22 branch January 21, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants