Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Leaving server while teleport command is executed hangs player in online state #57

Open
dasavick opened this issue Dec 2, 2018 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@dasavick
Copy link

dasavick commented Dec 2, 2018

PoC

  • Join server
  • Execute teleport command (eg. /tp 70 90 10)
  • Leave server while command is executing
  • Just look, server is broken and player counter says you're still online

obraz

Error after executing command and leaving

2018-12-02 14:10:14.019  INFO 17844 --- [chatExec1] r.c.g.c.l.IncomingChatPacketListener     : Command from Daffit(6876ea60-bd07-4039-b2d0-c88333eaf229): /tp 70 90 10
2018-12-02 14:10:14.043  WARN 17844 --- [commandExec1] o.s.c.s.ResourceBundleMessageSource      : ResourceBundle [lang/messages] not found for MessageSource: Can't find bundle for base name lang/messages, locale es_MX
2018-12-02 14:10:16.549  INFO 17844 --- [nioEventLoopGroup-6-2] r.c.n.n.p.inbound.IdentificationHandler  : Connection from 127.0.0.1 closed
2018-12-02 14:10:25.965  INFO 17844 --- [nioEventLoopGroup-6-1] r.c.n.n.p.inbound.IdentificationHandler  : New connection from 127.0.0.1
2018-12-02 14:10:25.967  INFO 17844 --- [nioEventLoopGroup-6-1] r.c.n.n.p.inbound.IdentificationHandler  : Connection from 127.0.0.1 closed
2018-12-02 14:10:26.258 DEBUG 17844 --- [playerExec1] r.c.p.l.PlayerMoveChunkLoadListener      : done loading chunks for Daffit
2018-12-02 14:10:26.291 DEBUG 17844 --- [playerExec1] r.c.p.l.PlayerMoveChunkLoadListener      : loading chunks around 4:0 for Daffit
2018-12-02 14:10:30.832  INFO 17844 --- [nioEventLoopGroup-6-3] r.c.n.n.p.inbound.IdentificationHandler  : New connection from 127.0.0.1
2018-12-02 14:10:30.832  INFO 17844 --- [nioEventLoopGroup-6-3] r.c.n.n.p.inbound.IdentificationHandler  : Connection from 127.0.0.1 closed
2018-12-02 14:10:30.836  INFO 17844 --- [nioEventLoopGroup-6-4] r.c.n.n.p.inbound.IdentificationHandler  : New connection from 127.0.0.1
2018-12-02 14:10:30.841  INFO 17844 --- [nioEventLoopGroup-6-4] r.c.n.n.p.inbound.IdentificationHandler  : Connection from 127.0.0.1 closed
2018-12-02 14:10:31.493 DEBUG 17844 --- [playerExec1] r.c.p.l.PlayerMoveChunkLoadListener      : done loading chunks for Daffit
2018-12-02 14:10:31.498 DEBUG 17844 --- [playerExec1] r.c.p.listener.PlayerTeleportListener    : Daffit now has entity id -1
2018-12-02 14:10:31.500  INFO 17844 --- [playerExec1] r.cleanstone.player.SimplePlayerManager  : Terminating player
2018-12-02 14:10:31.501 DEBUG 17844 --- [taskExecutor1] r.c.game.entity.SimpleEntityTracker      : observer AbstractEntity{entityID=0} now tracks AbstractEntity{entityID=2}
2018-12-02 14:10:31.510 ERROR 17844 --- [playerExec1] .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public void rocks.cleanstone.player.listener.PlayerTerminationCauseListener.onPlayerConnectionClosed(rocks.cleanstone.net.event.ConnectionClosedEvent)

java.lang.IllegalStateException: given entity is not an observer
	at com.google.common.base.Preconditions.checkState(Preconditions.java:507) ~[guava-27.0-jre.jar:na]
	at rocks.cleanstone.game.entity.SimpleEntityTracker.removeObserver(SimpleEntityTracker.java:47) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:206) ~[spring-aop-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at com.sun.proxy.$Proxy100.removeObserver(Unknown Source) ~[na:na]
	at rocks.cleanstone.player.terminate.RemoveEntity.onTerminate(RemoveEntity.java:26) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:261) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:180) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:142) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:398) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:368) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at rocks.cleanstone.core.event.CleanstoneEventPublisher.publishEvent(CleanstoneEventPublisher.java:23) ~[classes/:na]
	at rocks.cleanstone.core.CleanstoneServer.publishEvent(CleanstoneServer.java:48) ~[classes/:na]
	at rocks.cleanstone.core.CleanstoneServer.publishEvent(CleanstoneServer.java:44) ~[classes/:na]
	at rocks.cleanstone.player.SimplePlayerManager.terminatePlayer(SimplePlayerManager.java:139) ~[classes/:na]
	at java.util.Optional.ifPresent(Optional.java:159) ~[na:1.8.0_191]
	at rocks.cleanstone.player.listener.PlayerTerminationCauseListener.onPlayerConnectionClosed(PlayerTerminationCauseListener.java:35) ~[classes/:na]
	at rocks.cleanstone.player.listener.PlayerTerminationCauseListener$$FastClassBySpringCGLIB$$67007259.invoke(<generated>) ~[classes/:na]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) ~[spring-aop-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[na:1.8.0_191]
	at java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:1.8.0_191]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_191]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_191]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_191]

Error when trying to join again

2018-12-02 14:16:37.213  INFO 17844 --- [mcLoginExec1] r.c.net.minecraft.login.LoginManager     : Player Daffit (6876ea60-bd07-4039-b2d0-c88333eaf229) logged in
2018-12-02 14:16:37.214  INFO 17844 --- [playerExec1] r.cleanstone.player.SimplePlayerManager  : Terminating player
2018-12-02 14:16:37.218 ERROR 17844 --- [playerExec1] .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public synchronized void rocks.cleanstone.player.listener.PlayerInitializationCauseListener.onPlayerLoginSuccess(rocks.cleanstone.net.minecraft.login.event.AsyncLoginSuccessEvent)

java.lang.IllegalStateException: Cannot terminate already terminated / non-initialized player 6876ea60-bd07-4039-b2d0-c88333eaf229
	at com.google.common.base.Preconditions.checkState(Preconditions.java:507) ~[guava-27.0-jre.jar:na]
	at rocks.cleanstone.player.SimplePlayerManager.terminatePlayer(SimplePlayerManager.java:136) ~[classes/:na]
	at rocks.cleanstone.player.listener.PlayerInitializationCauseListener.onPlayerLoginSuccess(PlayerInitializationCauseListener.java:38) ~[classes/:na]
	at rocks.cleanstone.player.listener.PlayerInitializationCauseListener$$FastClassBySpringCGLIB$$1e6108bd.invoke(<generated>) ~[classes/:na]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) ~[spring-aop-5.1.2.RELEASE.jar:5.1.2.RELEASE]
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[na:1.8.0_191]
	at java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:1.8.0_191]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_191]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_191]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_191]
@LeonMangler LeonMangler added bug Something isn't working good first issue Good for newcomers labels Dec 2, 2018
@LeonMangler
Copy link
Member

Can confirm with v0.3.1

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants