{"record":{"id":"4d17b0284f68586f","repo":"egametang/ET","slug":"err-actorlocationsendertimeout3","errorCode":"ERR_ActorLocationSenderTimeout3","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":272,"sourceCode":"                    {\n                        throw new RpcException(ErrorCode.ERR_ActorLocationSenderTimeout2, $\"{iRequest}\");\n                    }\n\n                    messageLocationSender.ActorId = locationActorId;\n                }\n\n                if (messageLocationSender.ActorId == default)\n                {\n                    return MessageHelper.CreateResponse(requestType, 0, ErrorCode.ERR_NotFoundActor);\n                }\n\n                root = rootRef;\n                ActorId targetActorId = messageLocationSender.ActorId;\n                IResponse response = await root.GetComponent<MessageSender>().Call(targetActorId, iRequest, needException: false);\n                messageLocationSender = messageLocationSenderRef;\n                if (messageLocationSender == null)\n                {\n                    throw new RpcException(ErrorCode.ERR_ActorLocationSenderTimeout3, $\"{requestType.FullName}\");\n                }\n                \n                switch (response.Error)\n                {\n                    case ErrorCode.ERR_NotFoundActor:\n                    {\n                        // 如果没找到Actor,重试\n                        ++failTimes;\n                        if (failTimes > 10)\n                        {\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                            }","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.actorlocation/Scripts/Hotfix/Server/MessageLocationSenderComponentSystem.cs#L254-L290","documentation":"In CallInner, the actual RPC (MessageSender.Call with needException:false) to the target actor completed and returned a response. After the await, messageLocationSender was re-acquired from EntityRef and found null — the sender was disposed during the RPC round-trip to the target. The response was received but the originating sender no longer exists to process the retry logic.","triggerScenarios":"Call(entityId, iLocationRequest) where the sender is disposed (Check timer, explicit Remove) during the MessageSender.Call to the target actor.","commonSituations":"Target actor's response takes long enough for the Check timer to expire the sender. High network latency to the target. Target actor is overloaded, widening the RPC window past TIMEOUT_TIME.","solutions":["Catch RpcException with ERR_ActorLocationSenderTimeout3.","Increase MessageLocationSenderOneType.TIMEOUT_TIME if RPCs are expected to be slow.","Reduce target actor response latency.","Keep the sender's LastSendOrRecvTime fresh by reducing idle gaps."],"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_ActorLocationSenderTimeout3)\n{\n    // Sender disposed during the RPC round-trip — retry\n    IResponse resp = await senderOneType.Call(entityId, iLocationRequest);\n}","preventionTips":["Increase MessageLocationSenderOneType.TIMEOUT_TIME if RPCs are expected to be slow.","Reduce target actor response latency.","Keep LastSendOrRecvTime fresh to prevent Check timer from expiring the sender mid-RPC."],"tags":["message-routing","entity-disposed","rpc-call","location-request"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}