[PR #557] [MERGED] Fix infinite loop on fast TCP disconnection #1656

Closed
opened 2026-05-05 07:58:45 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/debauchee/barrier/pull/557
Author: @galkinvv
Created: 2/9/2020
Status: Merged
Merged: 2/13/2020
Merged by: @AdrianKoshka

Base: masterHead: fix-loop-tcp-disconnection


📝 Commits (1)

  • c79120c Fix infinite loop on fast TCP disconnection

📊 Changes

3 files changed (+17 additions, -15 deletions)

View changed files

📝 src/lib/net/SecureSocket.cpp (+2 -2)
📝 src/lib/net/TCPSocket.cpp (+13 -12)
📝 src/lib/net/TCPSocket.h (+2 -1)

📄 Description

The commit a841b28 changed the condition for removing job from processing.
New flag MultiplexerJobStatus::continue_servicing become used
instead of checking pointer for NULL.
However for cases when TCPSocket::newJob() returns nullptr
the behaviour changed: earlier the job was removed, but after change
it is called again, since MultiplexerJobStatus equal to {true, nullptr}
means "run this job again".

This leads to problem with eating CPU and RAM on linux
https://github.com/debauchee/barrier/issues/470

There is similar windows problem, but not sure it is related.
https://github.com/debauchee/barrier/issues/552

Since it looks that the goal of a841b28 was only clarifying
object ownership and not changing job deletion behaviour,
this commit tries to get original behaviour and fix the bugs above
by returning {false, nullptr} instead of {true, nullptr}
when TCPSocket::newJob() returns nullptr.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/debauchee/barrier/pull/557 **Author:** [@galkinvv](https://github.com/galkinvv) **Created:** 2/9/2020 **Status:** ✅ Merged **Merged:** 2/13/2020 **Merged by:** [@AdrianKoshka](https://github.com/AdrianKoshka) **Base:** `master` ← **Head:** `fix-loop-tcp-disconnection` --- ### 📝 Commits (1) - [`c79120c`](https://github.com/debauchee/barrier/commit/c79120c049d825fedeed70d5a1a9dc64d17ce9f0) Fix infinite loop on fast TCP disconnection ### 📊 Changes **3 files changed** (+17 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/net/SecureSocket.cpp` (+2 -2) 📝 `src/lib/net/TCPSocket.cpp` (+13 -12) 📝 `src/lib/net/TCPSocket.h` (+2 -1) </details> ### 📄 Description The commit a841b28 changed the condition for removing job from processing. New flag MultiplexerJobStatus::continue_servicing become used instead of checking pointer for NULL. However for cases when TCPSocket::newJob() returns nullptr the behaviour changed: earlier the job was removed, but after change it is called again, since MultiplexerJobStatus equal to {true, nullptr} means "run this job again". This leads to problem with eating CPU and RAM on linux https://github.com/debauchee/barrier/issues/470 There is similar windows problem, but not sure it is related. https://github.com/debauchee/barrier/issues/552 Since it looks that the goal of a841b28 was only clarifying object ownership and not changing job deletion behaviour, this commit tries to get original behaviour and fix the bugs above by returning {false, nullptr} instead of {true, nullptr} when TCPSocket::newJob() returns nullptr. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 07:58:45 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#1656
No description provided.