Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Redis connection not reinstated on connection failure.

未关闭
#834 10 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java, redis
领域
databases

调研方向

从 RedisDataSource.java 开始,重点查看 get0,并检查共享的 Redis PSN 配置如何创建和使用其连接。重现 issue 中描述的空闲服务器故障,然后验证后续的 Redis 读取能够重新建立连接,而无需 /reloadalias。

由索引模型根据 Issue 内容生成。

描述

bug

CMDHELPER-2829 - Reported by CyaNox

After having the test server idle for a while (no scripts calling any PSN calls that would store in the Redis PSN) the following error popped up once it tried to retrieve a value from the Redis PSN:

The line in question is nothing wrong with as it works perfectly fine after boot up and also after a /reloadalias but for completeness sake I'll add the line of code as well:

  ...
  @g = get_value('redis.permissions.' . @where . 's') # @@@ The line that initiated the error @@@
  ...

The error:

20:51:15 [INFO] IOException: com.laytonsmith.libs.redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe
        proc _permissions_permission_ex:/.../Permissions.inc.ms:159
        proc _permissions_add_permission_to_group:/.../Permissions.inc.ms:194
        <<main code>>:/.../Permissions.msa:16

20:51:15 [SEVERE] The previous MethodScript error had an attached cause:
20:51:15 [SEVERE] com.laytonsmith.persistance.DataSourceException: com.laytonsmith.libs.redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe
20:51:15 [SEVERE]       at com.laytonsmith.persistance.RedisDataSource.get0(RedisDataSource.java:112)
20:51:15 [SEVERE]       at com.laytonsmith.persistance.AbstractDataSource.get(AbstractDataSource.java:68)
20:51:15 [SEVERE]       at com.laytonsmith.persistance.PersistanceNetwork.get(PersistanceNetwork.java:110)
20:51:15 [SEVERE]       at com.laytonsmith.core.functions.Persistance$get_value.exec(Persistance.java:151)
20:51:15 [SEVERE]       at com.laytonsmith.core.Script.eval(Script.java:310)
20:51:15 [SEVERE]       at com.laytonsmith.core.Script.eval(Script.java:272)
20:51:15 [SEVERE]       at com.laytonsmith.core.Procedure.execute(Procedure.java:191)
20:51:15 [SEVERE]       at com.laytonsmith.core.Procedure.cexecute(Procedure.java:149)
20:51:15 [SEVERE]       at com.laytonsmith.core.Script.eval(Script.java:239)
20:51:15 [SEVERE]       at com.laytonsmith.core.Script.eval(Script.java:272)
20:51:15 [SEVERE]       at com.laytonsmith.core.Procedure.execute(Procedure.java:194)
20:51:15 [SEVERE]       at com.laytonsmith.core.Procedure.cexecute(Procedure.java:149)
20:51:15 [SEVERE]       at com.laytonsmith.core.Script.eval(Script.java:239)
20:51:15 [SEVERE]       at com.laytonsmith.core.Script.seval(Script.java:210)
20:51:15 [SEVERE]       at com.laytonsmith.core.Procedure.cexecute(Procedure.java:147)
20:51:15 [SEVERE]       at com.laytonsmith.core.Script.eval(Script.java:239)
20:51:15 [SEVERE]       at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1494)
20:51:15 [SEVERE]       at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1454)
20:51:15 [SEVERE]       at com.laytonsmith.core.Script.run(Script.java:164)
20:51:15 [SEVERE]       at com.laytonsmith.core.AliasCore.alias(AliasCore.java:150)
20:51:15 [SEVERE]       at com.laytonsmith.commandhelper.CommandHelperServerListener.onServerCommand(CommandHelperServerListener.java:41)
20:51:15 [SEVERE]       at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
20:51:15 [SEVERE]       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
20:51:15 [SEVERE]       at java.lang.reflect.Method.invoke(Method.java:606)
20:51:15 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
20:51:15 [SEVERE]       at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
20:51:15 [SEVERE]       at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30)
20:51:15 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478)
20:51:15 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463)
20:51:15 [SEVERE]       at net.minecraft.server.v1_6_R3.DedicatedServer.as(DedicatedServer.java:272)
20:51:15 [SEVERE]       at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:241)
20:51:15 [SEVERE]       at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:493)
20:51:15 [SEVERE]       at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:425)
20:51:15 [SEVERE]       at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
20:51:15 [SEVERE] Caused by: com.laytonsmith.libs.redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe
20:51:15 [SEVERE]       at com.laytonsmith.libs.redis.clients.jedis.Connection.flush(Connection.java:66)
20:51:15 [SEVERE]       at com.laytonsmith.libs.redis.clients.jedis.Connection.getBinaryBulkReply(Connection.java:180)
20:51:15 [SEVERE]       at com.laytonsmith.libs.redis.clients.jedis.Connection.getBulkReply(Connection.java:171)
20:51:15 [SEVERE]       at com.laytonsmith.libs.redis.clients.jedis.Jedis.get(Jedis.java:67)
20:51:15 [SEVERE]       at com.laytonsmith.persistance.RedisDataSource.get0(RedisDataSource.java:109)
20:51:15 [SEVERE]       ... 33 more
20:51:15 [SEVERE] Caused by: java.net.SocketException: Broken pipe
20:51:15 [SEVERE]       at java.net.SocketOutputStream.socketWrite0(Native Method)
20:51:15 [SEVERE]       at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
20:51:15 [SEVERE]       at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
20:51:15 [SEVERE]       at com.laytonsmith.libs.redis.clients.util.RedisOutputStream.flushBuffer(RedisOutputStream.java:29)
20:51:15 [SEVERE]       at com.laytonsmith.libs.redis.clients.util.RedisOutputStream.flush(RedisOutputStream.java:227)
20:51:15 [SEVERE]       at com.laytonsmith.libs.redis.clients.jedis.Connection.flush(Connection.java:64)
20:51:15 [SEVERE]       ... 37 more

Relevant PSN config:

$shared=redis://localhost:6379?timeout=90&password=pass

# Shared
storage.redis.**=$shared
主要语言
Java
星标
128
派生
70
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

EngineHub/CommandHelper 的其他 Issue

查看 EngineHub/CommandHelper 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。