You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.
每次使用 /heh view 浏览商城时,会新建一个 mysql 的 connection,之后该 connection 会一只处于 sleep 的状态,不会自行 kill 掉,从而占用 mysql 的可用连接池。一旦 connections 超过了 max_connections,/heh view 就无法再使用。该问题还导致其他使用 mysql 的功能/程序不能正常运行,例如 heh的木牌商店,CoreProtect 等需要用到 mysql 的插件
如何确认以上问题
设置 heh 使用 mysql
打开 mysql 的命令行
每当使用 /heh view 后,命令行里输入 show processlist; 会看见有一个新的 connection 出现,而且很长时间内不会自动关闭
Bug reproduction steps
不断重复 /heh view 操作,从而新建 connections。直到 connections 超过 mysql 的 max_connections,那么后台就会出现如下提示:
[23:38:50 INFO]: Nailm issued server command: /heh view
[23:38:50 WARN]: java.lang.RuntimeException: connection failed: root@jdbc:MySQL://localhost:3306/heh?useSSL=false&verifyServerCertificate=false
[23:38:50 WARN]: at cat.nyaa.nyaacore.database.provider.MysqlDatabase.createConnection(MysqlDatabase.java:51)
[23:38:50 WARN]: at cat.nyaa.nyaacore.database.relational.BaseDatabase.newConnection(BaseDatabase.java:48)
[23:38:50 WARN]: at cat.nyaa.nyaacore.database.provider.MysqlDatabase.queryTransactional(MysqlDatabase.java:86)
[23:38:50 WARN]: at cat.nyaa.nyaacore.database.provider.MysqlDatabase.queryTransactional(MysqlDatabase.java:15)
[23:38:50 WARN]: at cat.nyaa.HamsterEcoHelper.database.Database.getMarketItems(Database.java:106)
[23:38:50 WARN]: at cat.nyaa.HamsterEcoHelper.market.MarketGUI.openGUI(MarketGUI.java:77)
[23:38:50 WARN]: at cat.nyaa.HamsterEcoHelper.market.MarketManager.openGUI(MarketManager.java:106)
[23:38:50 WARN]: at cat.nyaa.HamsterEcoHelper.market.MarketCommands.view(MarketCommands.java:63)
[23:38:50 WARN]: at jdk.internal.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
[23:38:50 WARN]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[23:38:50 WARN]: at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[23:38:50 WARN]: at cat.nyaa.nyaacore.CommandReceiver.acceptCommand(CommandReceiver.java:207)
[23:38:50 WARN]: at cat.nyaa.nyaacore.CommandReceiver.acceptCommand(CommandReceiver.java:205)
[23:38:50 WARN]: at cat.nyaa.nyaacore.CommandReceiver.onCommand(CommandReceiver.java:180)
[23:38:50 WARN]: at cat.nyaa.HamsterEcoHelper.CommandHandler.onCommand(CommandHandler.java:63)
[23:38:50 WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[23:38:50 WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159)
[23:38:50 WARN]: at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:739)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1831)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1639)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:5)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:18)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:127)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:105)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.aW(MinecraftServer.java:1002)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:995)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:115)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:979)
[23:38:50 WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:912)
[23:38:50 WARN]: at java.base/java.lang.Thread.run(Thread.java:834)
[23:38:50 WARN]: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
[23:38:50 WARN]: at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[23:38:50 WARN]: at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[23:38:50 WARN]: at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[23:38:50 WARN]: at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
[23:38:50 WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
[23:38:50 WARN]: at com.mysql.jdbc.Util.getInstance(Util.java:408)
[23:38:50 WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
[23:38:50 WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
[23:38:50 WARN]: at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
[23:38:50 WARN]: at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1038)
[23:38:50 WARN]: at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2199)
[23:38:50 WARN]: at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230)
[23:38:50 WARN]: at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025)
[23:38:50 WARN]: at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
[23:38:50 WARN]: at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
[23:38:50 WARN]: at jdk.internal.reflect.GeneratedConstructorAccessor75.newInstance(Unknown Source)
[23:38:50 WARN]: at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[23:38:50 WARN]: at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
[23:38:50 WARN]: at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
[23:38:50 WARN]: at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
[23:38:50 WARN]: at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
[23:38:50 WARN]: at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
[23:38:50 WARN]: at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
[23:38:50 WARN]: at cat.nyaa.nyaacore.database.provider.MysqlDatabase.createConnection(MysqlDatabase.java:48)
[23:38:50 WARN]: ... 32 more
游戏内会提示
mysql 命令行执行 show processlist; 的结果:
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
问题
每次使用
/heh view
浏览商城时,会新建一个 mysql 的 connection,之后该 connection 会一只处于 sleep 的状态,不会自行 kill 掉,从而占用 mysql 的可用连接池。一旦 connections 超过了 max_connections,/heh view
就无法再使用。该问题还导致其他使用 mysql 的功能/程序不能正常运行,例如 heh的木牌商店,CoreProtect 等需要用到 mysql 的插件如何确认以上问题
/heh view
后,命令行里输入show processlist;
会看见有一个新的 connection 出现,而且很长时间内不会自动关闭Bug reproduction steps
不断重复
/heh view
操作,从而新建 connections。直到 connections 超过 mysql 的max_connections
,那么后台就会出现如下提示:游戏内会提示
mysql 命令行执行
show processlist;
的结果:The text was updated successfully, but these errors were encountered: