EngineHub / EngineHub/CommandHelper
Redis connection not reinstated on connection failure.
- Dominant language
- Java
- Stars
- 128
- Forks
- 70
- PR merge metrics
- No merged PRs in 30d
Description
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
<>:/.../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
```
Contributor guide
Assessment
This issue has not been assessed yet.