[PR #6140] [CLOSED] fix(mtproto): synchronize child process state #6103

Closed
opened 2026-11-02 04:06:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6140
Author: @PathGao
Created: 7/29/2026
Status: ❌ Closed

Base: main ← Head: fix-mtproto-process-race


📝 Commits (1)

  • 61f78a3 fix(mtproto): synchronize child-process state

📊 Changes

1 file changed (+41 additions, -24 deletions)

View changed files

📝 internal/mtproto/process.go (+41 -24)

📄 Description

Summary

The MTProto child-process watcher called Cmd.Wait while status and shutdown paths read mutable exec.Cmd fields. Lifecycle state is now snapshotted under a mutex and completion is determined by the process-owned done channel, preventing Wait/ProcessState races during reload and shutdown.

Validation

  • make verify
  • go test -race -shuffle=on -count=1 ./internal/mtproto

🔄 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/MHSanaei/3x-ui/pull/6140 **Author:** [@PathGao](https://github.com/PathGao) **Created:** 7/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-mtproto-process-race` --- ### 📝 Commits (1) - [`61f78a3`](https://github.com/MHSanaei/3x-ui/commit/61f78a341a5b032ad5cedf759bec3e80040311db) fix(mtproto): synchronize child-process state ### 📊 Changes **1 file changed** (+41 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `internal/mtproto/process.go` (+41 -24) </details> ### 📄 Description ## Summary The MTProto child-process watcher called `Cmd.Wait` while status and shutdown paths read mutable `exec.Cmd` fields. Lifecycle state is now snapshotted under a mutex and completion is determined by the process-owned done channel, preventing `Wait`/`ProcessState` races during reload and shutdown. ## Validation - `make verify` - `go test -race -shuffle=on -count=1 ./internal/mtproto` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:06:23 +07: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
MHSanaei/3x-ui#6103
No description provided.