MessagePackSerializer.DeserializeAsync blocks for a complete read
還沒有人認領這個 Issue。
評估
研究方向
從 src/MessagePack/MessagePackSerializer.cs 第 346 行附近開始,使用此處描述的 112 位元組訊息,透過 DeserializeAsync 重現 .NET 8 用戶端/伺服器序列。追蹤完整物件是否已在下一次讀取串流之前被消費,並透過一個針對性的回歸測試驗證預期的回傳行為。
由索引模型根據 Issue 內容生成。
描述
MessagePack 3.1.4, targeting .NET 8.
I'm seeing a deadlock for a quite simple client/server solution. Basically it goes like this:
- Client writes message X (112 bytes):
SerializeAsync - Client reads (waits) for message Y (response to X):
DeserializeAsync - Server reads message X (112 bytes):
DeserializeAsync- blocks in second call in while loop. See below!
So the server never exits the read call, not allowing it to write an answer to the client. While debugging, I identified the cause of this. See this line in MessagePackSerializer.DeserializeAsync:
There, the server has read 112 bytes but the loop takes it back to the stream.ReadAsync() call where it blocks.
Bug or not?
Is this expected behavior? I asked it to deserialize a message, and it got all bytes needed for it. What am I missing here?
The message sent (112 bytes written and 112 bytes read)
[MessagePackObject]
[Union(0, typeof(HelloMessage))]
// Additional unions...
public abstract class PipeMessage
{
[Key(0)]
public required Guid Id { get; init; }
}
[MessagePackObject]
public sealed class HelloMessage : PipeMessage
{
[Key(1)]
public required Guid SessionId { get; init; }
[Key(2)]
public required string Secret { get; init; }
[Key(3)]
public required int ProtocolVersion { get; init; }
}
- 主要語言
- C#
- 星號
- 6.8k
- 分支
- 778
- 平均合併
- 22 小時 8 分鐘
- 30 天內合併 PR
- 2
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
MessagePack-CSharp/MessagePack-CSharp 的其他 Issue
-
SerializableMemberTypeAnalyzer throws AD0001 when any referenced assembly has an assembly-level attribute with a single array argument可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
-
難度 1/5 1 小時以內 新手友好度 76/100
-
難度 2/5 1-3 小時 新手友好度 68/100
MessagePack-CSharp/MessagePack-CSharp#2276 · 2 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 66/100
MessagePack-CSharp/MessagePack-CSharp#2252 · 3 則留言 ·
-
難度 4/5 3-5 天 新手友好度 52/100
查看 MessagePack-CSharp/MessagePack-CSharp 的全部 Issue
相似的 Issue
-
kind/bug
難度 2/5 1-3 小時 新手友好度 78/100
unoplatform/uno#26555 ·
維護者通常 1 天內回覆
-
Search button on a book does not retry without the author when the full query finds nothing可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
Listenarrs/Listenarr#1173 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 77/100
CactuseSecurity/firewall-orchestrator#5739 ·
維護者通常 1 天內回覆
-
Add File sorts a picked file by VB6's extensions, not the project format's (#4243 follow-up)可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉chore project-system small
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
vikramlearning/blazorbootstrap#1388 ·
維護者通常 1 天內回覆