iohao / ioGame

无锁异步化、事件驱动架构设计的 java netty 网络编程框架; 轻量级,无需依赖任何第三方中间件或数据库就能支持集群、分布式; 适用于网络游戏服务器、物联网、内部系统及各种需要长连接的场景; 通过 ioGame 你可以很容易的搭建出一个集群无中心节点、集群自动化、分布式的网络服务器;FXGL、Unity、UE、Cocos Creator、Godot、Netty、Protobuf、webSocket、tcp、socket;java Netty 游戏服务器框架;

Home Page:http://game.iohao.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

踢出用户 有一定概率 出现超时

molin7596 opened this issue · comments

你的问题 | 使用场景

描述你遇到的问题,或使用场景(询问框架能否满足此类需求)

踢出用户超时

预期值

期望的预期值

踢出用户成功

实际值

实际值

踢出用户超时

复现步骤

描述复现步骤,并提供复现 demo

@ActionMethod(AuthCmd.AUTH)
    public boolean auth(CustomFlowContext flowContext, AuthMessage message) {
        AuthData authData = authService.check(message.ServerToken);
        ServerErrorCodeEnum.AUTH_ERROR.assertNonNull(authData);
        // 校验
        Long rsId = authData.getRsId();
        Long characterId = authData.getCharacterId();
        // 对外服 userId == 角色id
        //判断角色是否在线
        boolean online = ExternalCommunicationKit.existUser(characterId);
        if (online) {
            log.info("踢出用户:user_id:{}", characterId);
            //强制下线
            ExternalCommunicationKit.forcedOffline(characterId);
        }
        boolean success = UserIdSettingKit.settingUserId(flowContext, characterId);
        if (success) {
            log.info(STR."设置用户id( 角色id:\{characterId} )成功");
            // 角色上线
            this.online(flowContext);
        } else {
            log.error(STR."设置用户id( 角色id:\{characterId} )失败");
            ServerErrorCodeEnum.AUTH_ERROR.throwException();
            return false;
        }
        // 更新元信息
        // CustomAttachment attachment = new CustomAttachment();
        // attachment.userId = characterId;
        // attachment.rsId = rsId;
        // flowContext.updateAttachment(attachment);

        return true;
    }
2024-05-14 15:48:24 INFO  [User-8-2] com.yml.mlwy.action.AuthAction:43 - 踢出用户:user_id:1789993496741924865 
2024-05-14 15:48:27 ERROR [User-8-2] c.i.g.b.b.c.kit.UserIdSettingKit:99 - Rpc invocation timeout[responseCommand TIMEOUT]! the address is 127.0.0.1:12100 
com.alipay.remoting.rpc.exception.InvokeTimeoutException: Rpc invocation timeout[responseCommand TIMEOUT]! the address is 127.0.0.1:12100
	at com.alipay.remoting.rpc.RpcResponseResolver.preProcess(RpcResponseResolver.java:83)
	at com.alipay.remoting.rpc.RpcResponseResolver.resolveResponseObject(RpcResponseResolver.java:54)
	at com.alipay.remoting.rpc.RpcRemoting.invokeSync(RpcRemoting.java:186)
	at com.alipay.remoting.rpc.RpcClient.invokeSync(RpcClient.java:253)
	at com.iohao.game.bolt.broker.core.client.BrokerClientItem.invokeSync(BrokerClientItem.java:111)
	at com.iohao.game.bolt.broker.core.client.BrokerClient.invokeSync(BrokerClient.java:173)
	at com.iohao.game.bolt.broker.core.client.BrokerClient.invokeSync(BrokerClient.java:177)
	at com.iohao.game.bolt.broker.client.kit.UserIdSettingKit.settingUserId(UserIdSettingKit.java:83)
	at com.yml.mlwy.action.AuthAction.auth(AuthAction.java:47)
	at com.yml.mlwy.action.AuthActionMethodAccess.invoke(Unknown Source)
	at com.iohao.game.action.skeleton.core.flow.internal.DefaultActionMethodInvoke.invoke(DefaultActionMethodInvoke.java:46)
	at com.iohao.game.action.skeleton.core.DefaultActionCommandFlowExecute.execute(DefaultActionCommandFlowExecute.java:62)
	at com.iohao.game.action.skeleton.core.ActionCommandHandler.handler(ActionCommandHandler.java:41)
	at com.iohao.game.action.skeleton.core.BarSkeleton.handle(BarSkeleton.java:110)
	at com.iohao.game.action.skeleton.kit.ExecutorSelectKit.lambda$processLogic$0(ExecutorSelectKit.java:61)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)
2024-05-14 15:48:27 ERROR [User-8-2] com.yml.mlwy.action.AuthAction:53 - 设置用户id( 角色id:1789993496741924865 )失败 

版本

  • ioGame version: 21.6

是没问题了吗。

难以复现 提供不了demo

发现问题了, 是当前已设置用户ID的连接中, 踢出用户 重新设置 就超时了, 是我自己的问题