{"record":{"id":"e74fef13e9dac227","repo":"egametang/ET","slug":"err-actorlocationsendertimeout4","errorCode":"ERR_ActorLocationSenderTimeout4","errorMessage":"{requestType.FullName}","messagePattern":"\\{requestType\\.FullName\\}","errorType":"error_code","errorClass":"RpcException","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.actorlocation/Scripts/Hotfix/Server/MessageLocationSenderComponentSystem.cs","lineNumber":300,"sourceCode":"                        {\n                            Log.Debug($\"actor send message fail, actorid: {messageLocationSender.Id} {requestType.FullName}\");\n                            \n                            // 这里删除actor，后面等待发送的消息会判断InstanceId，InstanceId不一致返回ERR_NotFoundActor\n                            self = selfRef;\n                            if (self != null)\n                            {\n                                self.Remove(messageLocationSender.Id);\n                            }\n                            return response;\n                        }\n\n                        // 等待0.5s再发送\n                        root = rootRef;\n                        await root.TimerComponent.WaitAsync(failTimes * failTimes * 10);\n                        messageLocationSender = messageLocationSenderRef;\n                        if (messageLocationSender == null)\n                        {\n                            throw new RpcException(ErrorCode.ERR_ActorLocationSenderTimeout4, $\"{requestType.FullName}\");\n                        }\n\n                        messageLocationSender.ActorId = default;\n                        continue;\n                    }\n                    case ErrorCode.ERR_MessageTimeout:\n                    {\n                        throw new RpcException(response.Error, $\"{requestType.FullName}\");\n                    }\n                }\n\n                if (ErrorCode.IsRpcNeedThrowException(response.Error))\n                {\n                    throw new RpcException(response.Error, $\"Message: {response.Message} Request: {requestType.FullName}\");\n                }\n\n                return response;\n            }","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.actorlocation/Scripts/Hotfix/Server/MessageLocationSenderComponentSystem.cs#L282-L318","documentation":"In CallInner's ERR_NotFoundActor retry path, the code waits with quadratic backoff (WaitAsync(failTimes * failTimes * 10)). After the backoff await, messageLocationSender was re-acquired from EntityRef and found null — the sender was disposed during the backoff wait. The cumulative backoff across retries grew long enough for the sender to time out.","triggerScenarios":"Call(entityId, iLocationRequest) where the target returns ERR_NotFoundActor repeatedly, triggering retry with quadratic backoff, and the sender is disposed during a WaitAsync call.","commonSituations":"Actor migration in progress causing repeated NotFoundActor. Long NotFoundActor retry chains (up to 10 iterations). Sender times out during cumulative backoff (10+40+90+160+250+... ms).","solutions":["Catch RpcException with ERR_ActorLocationSenderTimeout4.","Ensure the actor's location is registered before sending to avoid NotFoundActor.","Stabilize actor placement to prevent migration churn.","Investigate why the target actor is unreachable (crashed, wrong scene, not yet started)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    IResponse resp = await senderOneType.Call(entityId, iLocationRequest);\n}\ncatch (RpcException e) when (e.Error == ErrorCode.ERR_ActorLocationSenderTimeout4)\n{\n    // Sender disposed during backoff wait — retry\n    IResponse resp = await senderOneType.Call(entityId, iLocationRequest);\n}","preventionTips":["Ensure the actor's location is registered before sending to avoid NotFoundActor retries.","Stabilize actor placement to prevent migration churn.","Investigate why the target is repeatedly returning NotFoundActor."],"tags":["message-routing","entity-disposed","retry","backoff","not-found-actor","location-request"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}