Comments (20)
@dsrees Cool sounds great thanks.
In the mean time I wrapped the changes to channels in synchronise blocks, hopefully that will help, I'll report back if that helps the crash rate, most likely next week.
For reference: https://github.com/8bytes/JavaPhoenixClient
from javaphoenixclient.
@AdamGrzybkowski do you see any pattern in these? Is it during disconnect, are you removing channels manually, is there a network error, how many channels do you have open at once?
I'll try to dig into this, but if you could figure out if its consistently reproducible, then that would obviously be helpful.
from javaphoenixclient.
@dsrees It happened only once for now. I do open only one channel. Not sure about other things right now.
from javaphoenixclient.
hey, I'm getting something similar:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.phoenixframework.PhxChannel.trigger(org.phoenixframework.PhxMessage)' on a null object reference
at org.phoenixframework.PhxSocket.triggerChannelError(PhxSocket.kt:387)
at org.phoenixframework.PhxSocket.onConnectionError(PhxSocket.kt:354)
at org.phoenixframework.PhxSocket.onFailure(PhxSocket.kt:443)
at okhttp3.internal.ws.RealWebSocket.failWebSocket(RealWebSocket.java:570)
at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:215)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
I was wondering could it be a race condition with the channel removing itself from the socket and the socket itself getting a connection error?
Again I'm afraid I have no way to reproduce this
from javaphoenixclient.
@eoinoconnell that's my theory as well. Thanks for your report, I'll try to see if I can get to this soon.
from javaphoenixclient.
Hey, so that didn't resolve the issue for me, which makes sense to be fair as I was only connecting to one Chanel.
I did take another look at my own code and found that my bug was on my end. I was accidentally initialising the socket more than once so it was to do with a race condition with disconnecting the first while it was connecting to a new instance and closing the socket and Chanel .
Sorry for wasting your time, thanks for the library
from javaphoenixclient.
@eoinoconnell 👍 not a problem! Glad your issue was resolved.
from javaphoenixclient.
I hit the original issue here as well. I'll try to pay attention and figure out what I was doing at the time. My trace is slightly different.
E/AndroidRuntime: FATAL EXCEPTION: Timer-929 Process: PID: 32105 java.util.ConcurrentModificationException at java.util.ArrayList$Itr.next(ArrayList.java:860) at org.phoenixframework.PhxChannel.trigger(PhxChannel.kt:384) at org.phoenixframework.PhxPush.trigger(PhxPush.kt:191) at org.phoenixframework.PhxPush$startTimeout$$inlined$schedule$1.run(Timer.kt:149) at java.util.TimerThread.mainLoop(Timer.java:562) at java.util.TimerThread.run(Timer.java:512)
from javaphoenixclient.
I have same issue. When I send message every 100 ms
com.arstats.retranslator E/AndroidRuntime: FATAL EXCEPTION: Timer-5
Process: com.arstats.retranslator, PID: 12147
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.next(ArrayList.java:860)
at org.phoenixframework.PhxChannel.trigger(PhxChannel.kt:384)
at org.phoenixframework.PhxPush.trigger(PhxPush.kt:191)
at org.phoenixframework.PhxPush$startTimeout$$inlined$schedule$1.run(Timer.kt:149)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
from javaphoenixclient.
I have this code
private const val SEND_INTERVAL: Long = 100
socket?.let {
val chatroom = it.channel("receiver:general")
chatroom.join()
.receive("ok") {
while (isStart) {
val payload: HashMap<String, Any> = HashMap()
... init payload
chatroom.push("source", payload)
SystemClock.sleep(SEND_INTERVAL)
}
}
.receive("error") { }
}
from javaphoenixclient.
Ok I reproduced this again. Like @Helmt89 my code is pushing messages very frequently, about 20 times a second.
from javaphoenixclient.
@dustinconrad @Helmt89 great! good find. I'll see if I can expose the issue as well and get a fix out for it.
from javaphoenixclient.
Hi guise) Now after your fix, I have problem with heartbeat after 1 minut - error: Transport: Heartbeat timeout. Attempt to re-establish connection
from javaphoenixclient.
The default heartbeat timeout is 30s. Did you set it to 60s or is it failing after 2 heartbeats?
from javaphoenixclient.
FYI, this is now available in the 0.1.4
release
from javaphoenixclient.
Fail after second heardbeat. Now I disable try/catch logic with heardbeat. This decision work ~ 5 minuts, then I have fatal crash with sochet.
from javaphoenixclient.
Is the same code that you posted above the code that is failing for you? Also are you getting the same Fatal Exception: java.util.ConcurrentModificationException
error?
from javaphoenixclient.
Yes this is same code
E/BeaconsActivity: Socket Error null
java.net.SocketException: Connection reset
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at okio.Okio$1.write(Okio.java:79)
at okio.AsyncTimeout$1.write(AsyncTimeout.java:180)
at okio.RealBufferedSink.emit(RealBufferedSink.java:186)
at okhttp3.internal.ws.WebSocketWriter.writeMessageFrame(WebSocketWriter.java:212)
at okhttp3.internal.ws.WebSocketWriter$FrameSink.close(WebSocketWriter.java:253)
at okio.RealBufferedSink.close(RealBufferedSink.java:248)
at okhttp3.internal.ws.RealWebSocket.writeOneFrame(RealWebSocket.java:500)
at okhttp3.internal.ws.RealWebSocket$1.run(RealWebSocket.java:159)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
from javaphoenixclient.
This is a different exception than the one this issue was opened for.
from javaphoenixclient.
agreed. @Helmt89 could you please open a new issue with as much information as you can provide regarding problem?
from javaphoenixclient.
Related Issues (20)
- Socket.removeFromSendBuffer --> NullPointerException
- Question about the heartbeat HOT 6
- Websocket is automatically reconnected event when intentionally closed HOT 2
- Leaking bindings when the channel reply times out? HOT 3
- Lots of Timers created HOT 2
- ReconnectAfterMs is too big HOT 1
- Downgrade OKhttp to 3.12.2 HOT 1
- Heartbeat seems to be sent only once (instead of every x seconds) HOT 2
- Reconnection strategy documentation HOT 8
- Decoding message payloads HOT 2
- ConcurrentModificationException crash HOT 3
- java.util.ConcurrentModificationException HOT 4
- JSON serialization defaults modify property names HOT 2
- jcenter shutdown - February 2022 HOT 3
- Message.payload marked as non-nullable but can be null HOT 7
- Tries to reconnect with invalid token HOT 3
- Leaving channel causes timeout HOT 5
- `unmatched topic` after reconnect HOT 1
- Issue with AGP v8.0.0 R8 minification HOT 1
- Release 1.1.3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javaphoenixclient.