Code Monkey home page Code Monkey logo

Comments (20)

eoinoconnell avatar eoinoconnell commented on August 15, 2024 2

@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.

dsrees avatar dsrees commented on August 15, 2024

@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.

AdamGrzybkowski avatar AdamGrzybkowski commented on August 15, 2024

@dsrees It happened only once for now. I do open only one channel. Not sure about other things right now.

from javaphoenixclient.

eoinoconnell avatar eoinoconnell commented on August 15, 2024

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.

dsrees avatar dsrees commented on August 15, 2024

@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.

eoinoconnell avatar eoinoconnell commented on August 15, 2024

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.

dsrees avatar dsrees commented on August 15, 2024

@eoinoconnell 👍 not a problem! Glad your issue was resolved.

from javaphoenixclient.

dustinconrad avatar dustinconrad commented on August 15, 2024

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.

Helmt89 avatar Helmt89 commented on August 15, 2024

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.

Helmt89 avatar Helmt89 commented on August 15, 2024

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.

dustinconrad avatar dustinconrad commented on August 15, 2024

Ok I reproduced this again. Like @Helmt89 my code is pushing messages very frequently, about 20 times a second.

from javaphoenixclient.

dsrees avatar dsrees commented on August 15, 2024

@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.

Helmt89 avatar Helmt89 commented on August 15, 2024

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.

dsrees avatar dsrees commented on August 15, 2024

The default heartbeat timeout is 30s. Did you set it to 60s or is it failing after 2 heartbeats?

from javaphoenixclient.

dsrees avatar dsrees commented on August 15, 2024

FYI, this is now available in the 0.1.4 release

from javaphoenixclient.

Helmt89 avatar Helmt89 commented on August 15, 2024

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.

dsrees avatar dsrees commented on August 15, 2024

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.

Helmt89 avatar Helmt89 commented on August 15, 2024

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.

dustinconrad avatar dustinconrad commented on August 15, 2024

This is a different exception than the one this issue was opened for.

from javaphoenixclient.

dsrees avatar dsrees commented on August 15, 2024

agreed. @Helmt89 could you please open a new issue with as much information as you can provide regarding problem?

from javaphoenixclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.