wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Meier <s...@meiers.net>
Subject Re: WebSocket concurrent modification
Date Wed, 20 May 2020 13:55:07 GMT
Hi,

I can reproduce the problem, but don't know yet what is causing this.

What I can see is that the page is properly locked when being accessed 
via Ajax or via a web socket push.
Thus a concurrent modification should not occur.

I'll have to investigate further.

Have fun
Sven


On 20.05.20 09:59, fanfy wrote:
> Hello,
>
> Maybe you can help me with a problem related to wicket 8.8.0 with websocket.
> Sometimes (usually when there are many ajax request in a short time
> interval) I encounter ConcurrentModificationException. The page store saving
> is synchronous. I created a sample project (attached  websocket-test.tar
> <http://apache-wicket.1842946.n4.nabble.com/file/t375849/websocket-test.tar>
> )
>
> mvn package
> java -jar target/websocket-test-0.0.1-SNAPSHOT.jar
> http://localhost:8080/)
>
> If clicking multiple times on 'New message' AjaxLink soon the exception is
> thrown. Internally I have a timer that creates messages on 50 milliseconds
> frequency (may be changed in src/main/resources/application.properties -
> fanfy.messsage-generator-frequency=50)
>
> Below is a sample stacktrace.
>
> Thank you.
>
> 2020-05-20 10:43:55.241 ERROR 246999 --- [nio-8080-exec-1]
> o.apache.wicket.DefaultExceptionMapper   : Unexpected error occurred
>
> java.util.ConcurrentModificationException: null
> 	at
> org.apache.commons.collections4.map.AbstractLinkedMap$LinkIterator.nextEntry(AbstractLinkedMap.java:574)
> ~[commons-collections4-4.4.jar!/:4.4]
> 	at
> org.apache.commons.collections4.map.AbstractLinkedMap$ValuesIterator.next(AbstractLinkedMap.java:506)
> ~[commons-collections4-4.4.jar!/:4.4]
> 	at
> org.apache.wicket.MarkupContainer$1MarkupChildIterator.refreshInternalIteratorIfNeeded(MarkupContainer.java:624)
> ~[wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.MarkupContainer$1MarkupChildIterator.hasNext(MarkupContainer.java:573)
> ~[wicket-core-8.8.0.jar!/:8.8.0]
> 	at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:134)
> ~[wicket-util-8.8.0.jar!/:8.8.0]
> 	at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
> ~[wicket-util-8.8.0.jar!/:8.8.0]
> 	at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
> ~[wicket-util-8.8.0.jar!/:8.8.0]
> 	at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
> ~[wicket-util-8.8.0.jar!/:8.8.0]
> 	at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)
> ~[wicket-util-8.8.0.jar!/:8.8.0]
> 	at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)
> ~[wicket-util-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:976)
> ~[wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.ComponentEventSender.breadth(ComponentEventSender.java:160)
> ~[wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.ComponentEventSender.send(ComponentEventSender.java:68)
> ~[wicket-core-8.8.0.jar!/:8.8.0]
> 	at org.apache.wicket.Component.send(Component.java:4413)
> ~[wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:349)
> ~[wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:914)
> ~[wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)
> ~[wicket-request-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:282)
> [wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)
> [wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)
> [wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.protocol.ws.AbstractUpgradeFilter.processRequestCycle(AbstractUpgradeFilter.java:70)
> [wicket-native-websocket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:206)
> [wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:299)
> [wicket-core-8.8.0.jar!/:8.8.0]
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [na:1.8.0_252]
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [na:1.8.0_252]
> 	at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> [tomcat-embed-core-9.0.35.jar!/:9.0.35]
> 	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_252]
>
> Exception in thread "Timer-0" java.lang.IllegalStateException: Message will
> not be sent because the WebSocket session has been closed
> 	at
> org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:430)
> 	at
> org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:309)
> 	at
> org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:250)
> 	at
> org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendString(WsRemoteEndpointImplBase.java:191)
> 	at
> org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendText(WsRemoteEndpointBasic.java:37)
> 	at
> org.apache.wicket.protocol.ws.javax.JavaxWebSocketConnection.sendMessage(JavaxWebSocketConnection.java:81)
> 	at
> org.apache.wicket.protocol.ws.api.WebSocketResponse.close(WebSocketResponse.java:92)
> 	at
> org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.broadcastMessage(AbstractWebSocketProcessor.java:287)
> 	at
> org.apache.wicket.protocol.ws.api.AbstractWebSocketConnection.sendMessage(AbstractWebSocketConnection.java:43)
> 	at
> fanfy.websocket.service.impl.MessageServiceImpl.broadcastWebSocketMessage(MessageServiceImpl.java:81)
> 	at
> fanfy.websocket.service.impl.MessageServiceImpl.addMessage(MessageServiceImpl.java:48)
> 	at
> fanfy.websocket.service.impl.MessageServiceImpl$1.run(MessageServiceImpl.java:59)
> 	at java.util.TimerThread.mainLoop(Timer.java:555)
> 	at java.util.TimerThread.run(Timer.java:505)
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message