Skip to content

Fix blocking send while holding request mutex - #40

Merged
wltry merged 3 commits into
mainfrom
fix-libwaterlinked-blocking-send
Aug 18, 2026
Merged

Fix blocking send while holding request mutex#40
wltry merged 3 commits into
mainfrom
fix-libwaterlinked-blocking-send

Conversation

@wltry

@wltry wltry commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Move send() outside request_mutex_ while preserving command ordering with send_mutex_. Also apply clang-tidy modernize fixes in client.cpp.

Changes Made

Changes to libwaterlinked client.cpp to resolve blocking issue.

Associated Issues

Resolves issue discussed in #32

Testing

Please provide a clear and concise description of the testing performed.

wltry and others added 2 commits August 17, 2026 10:19
Move send() outside request_mutex_ while preserving command ordering with send_mutex_. Also apply clang-tidy modernize fixes in client.cpp.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wltry wltry self-assigned this Aug 17, 2026
@wltry
wltry requested review from wlkh and a lite review from Copilot August 17, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the libwaterlinked TCP client to avoid holding the request-tracking mutex while performing a potentially blocking socket send(), while still preserving per-command ordering via a new dedicated send mutex.

Changes:

  • Serialize command transmission with a new send_mutex_, and narrow the scope of request_mutex_ to only pending-request bookkeeping.
  • Apply clang-tidy modernization updates (std::scoped_lock, designated initializers for CommandResponse).
  • Bump libwaterlinked package metadata (version and maintainer).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
libwaterlinked/src/client.cpp Moves command sending out from request_mutex_ and modernizes locking/struct initialization.
libwaterlinked/include/libwaterlinked/client.hpp Adds send_mutex_ to enforce send ordering without blocking request bookkeeping.
libwaterlinked/package.xml Updates package version and maintainer metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libwaterlinked/src/client.cpp Outdated
Comment thread libwaterlinked/package.xml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@wltry
wltry merged commit f115ad8 into main Aug 18, 2026
3 checks passed
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.

3 participants