Repository navigation
fix: retire Web mDNS without blocking session shutdown - #49
Merged
Merged
Conversation
Keep registration, network refresh and responder cleanup on a worker owned by each WebMdns lifecycle. Close only invalidates the lifecycle and queues cleanup, so service stop and hostname changes never wait for JmDNS while holding the WebSession monitor. Discard late responders and queued refreshes after retirement, keep multicast locks until cleanup finishes, and cover slow creation, registration, unregistration, network replacement and overlapping lifecycles with deterministic tests.
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
从 Android 主线程停止 Web 服务或修改 mDNS 主机名时,原实现会持有 WebSession 锁等待 JmDNS 注册/注销,多个接口可能累计等待数秒。现在 mDNS 的注册、网络刷新和清理均由各自生命周期的工作线程串行处理,停止只发出失效信号并排队清理,媒体查询无需等待 mDNS 注销。
验证:
./gradlew :common:testDebugUnitTest :mobile:compileDebugKotlin通过;common 共 397 个测试,零失败。可控慢注销测试在释放阻塞点前验证主线程停止、媒体查询和新实例发布均可完成,并检查旧资源最终只清理一次。真机验证待执行:多网络接口下反复启停 Web 服务、修改主机名及切换 Wi-Fi,检查界面响应、媒体请求、mDNS 解析和多播锁最终释放。当前云环境未连接目标 Android 真机,尚未完成真实设备上的 ANR/切网验证。
Fixes #46