Merge branch fix/trans-download-stream-drain
This commit is contained in:
@@ -15,6 +15,7 @@ from unideskcprovider import (
|
||||
DataChannel,
|
||||
ProviderManager,
|
||||
ProviderConfig,
|
||||
ProviderSession,
|
||||
UiBus,
|
||||
UpdateManager,
|
||||
configure_tcp_keepalive,
|
||||
@@ -144,6 +145,20 @@ class ProtocolHelpersTest(unittest.TestCase):
|
||||
configure_tcp_keepalive(value)
|
||||
value.setsockopt.assert_any_call(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
|
||||
|
||||
def test_session_exit_waits_for_all_output_pumps_to_drain(self):
|
||||
manager = MagicMock()
|
||||
process = MagicMock()
|
||||
process.wait.return_value = 0
|
||||
session = ProviderSession(manager, "session", MagicMock(), process)
|
||||
stdout_thread = MagicMock()
|
||||
stderr_thread = MagicMock()
|
||||
|
||||
session._wait(stdout_thread, stderr_thread)
|
||||
|
||||
stdout_thread.join.assert_called_once_with()
|
||||
stderr_thread.join.assert_called_once_with()
|
||||
manager.finish_session.assert_called_once_with("session", 0)
|
||||
|
||||
def test_recycles_only_the_oldest_expired_idle_channel(self):
|
||||
manager = ProviderManager.__new__(ProviderManager)
|
||||
manager.state_lock = provider.threading.RLock()
|
||||
|
||||
@@ -48,7 +48,7 @@ else:
|
||||
|
||||
|
||||
APP_NAME = "UniDesk Windows Provider"
|
||||
APP_VERSION = "0.3.2"
|
||||
APP_VERSION = "0.3.3"
|
||||
CONFIG_DIR = Path.home() / ".unidesk"
|
||||
CONFIG_PATH = CONFIG_DIR / "provider.yaml"
|
||||
LOG_DIR = CONFIG_DIR / "logs"
|
||||
@@ -802,8 +802,8 @@ class ProviderSession:
|
||||
|
||||
def _wait(self, stdout_thread: threading.Thread, stderr_thread: threading.Thread) -> None:
|
||||
exit_code = self.process.wait()
|
||||
stdout_thread.join(timeout=5)
|
||||
stderr_thread.join(timeout=5)
|
||||
stdout_thread.join()
|
||||
stderr_thread.join()
|
||||
self.manager.finish_session(self.id, exit_code)
|
||||
|
||||
def input(self, payload: bytes) -> None:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"channel": "stable",
|
||||
"latestVersion": "0.3.2",
|
||||
"latestVersion": "0.3.3",
|
||||
"downloadUrl": "unideskcprovider.py",
|
||||
"bytes": 73147,
|
||||
"sha256": "5b98d5f18bed0c1b3efd736bc3f9464681d8610cee3ebca64f844abc402900bf",
|
||||
"releaseNotes": "为 32 条 warm pool 启用 Windows TCP keepalive,避免旧空闲通道在并发传输时被网络设备重置。"
|
||||
"bytes": 73129,
|
||||
"sha256": "af6fc7ef2e36ca837674404d9cfa16a13351217a769d50d6e12fa649d56c01c4",
|
||||
"releaseNotes": "Provider 会在会话退出前完整排空 stdout/stderr,避免 32 路高压下载末尾数据被截断。"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user