Skip to content

java.lang.IllegalArgumentException: delay < 0 #349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
KrawczykPawel opened this issue Sep 29, 2016 · 2 comments
Closed

java.lang.IllegalArgumentException: delay < 0 #349

KrawczykPawel opened this issue Sep 29, 2016 · 2 comments
Labels

Comments

@KrawczykPawel
Copy link

KrawczykPawel commented Sep 29, 2016

I'm using io.socket:socket.io-client:0.8.1

The issue was already mentioned here:
[(https://github.com//issues/107)]

java.lang.IllegalArgumentException: delay < 0: -1012 at java.util.Timer.schedule(Timer.java:454) at io.socket.client.Manager.reconnect(Manager.java:544) at io.socket.client.Manager.onclose(Manager.java:524) at io.socket.client.Manager.access$1500(Manager.java:20) at io.socket.client.Manager$6.call(Manager.java:377) at io.socket.emitter.Emitter.emit(Emitter.java:117) at io.socket.engineio.client.Socket.onClose(Socket.java:812) at io.socket.engineio.client.Socket.onError(Socket.java:773) at io.socket.engineio.client.Socket.access$900(Socket.java:31) at io.socket.engineio.client.Socket$4.call(Socket.java:318) at io.socket.emitter.Emitter.emit(Emitter.java:117) at io.socket.engineio.client.Transport.onError(Transport.java:72) at io.socket.engineio.client.transports.WebSocket.access$500(WebSocket.java:28) at io.socket.engineio.client.transports.WebSocket$2$5.run(WebSocket.java:150) at io.socket.thread.EventThread$2.run(EventThread.java:80) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

@Xman-zhangsj
Copy link

me too,I'm using 'io.socket:socket.io-client:1.0.0'

logs:

11-25 18:31:45.005 2020 10604 E io.socket.g.a: Task threw exception
11-25 18:31:45.005 2020 10604 E io.socket.g.a: java.lang.IllegalArgumentException: Illegal execution time.
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at java.util.Timer.sched(Timer.java:395)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at java.util.Timer.schedule(Timer.java:200)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.client.c.o(Manager.java:576)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.client.c.i(Manager.java:251)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.client.c.e(Manager.java:30)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.client.c$1$3.call(Manager.java:313)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.b.a.a(Emitter.java:117)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.engineio.client.b.a(Socket.java:820)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.engineio.client.b.a(Socket.java:36)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.engineio.client.b$15.call(Socket.java:340)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.b.a.a(Emitter.java:117)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.engineio.client.Transport.a(Transport.java:64)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.engineio.client.a.c.a(WebSocket.java:24)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.engineio.client.a.c$1$5.run(WebSocket.java:107)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at io.socket.g.a$2.run(EventThread.java:80)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
11-25 18:31:45.005 2020 10604 E io.socket.g.a: at java.lang.Thread.run(Thread.java:764)

darrachequesne added a commit that referenced this issue Jul 2, 2022
Using a randomizationFactor value above 1 could lead to generating a
negative duration, then throwing:

> java.lang.IllegalArgumentException: delay < 0: -1012
> at java.util.Timer.schedule(Timer.java:454)
> at io.socket.client.Manager.reconnect(Manager.java:544)

This error does not seem related to a long overflow (in the
BigInteger.longValue() operation), because the BigInteger.min(this.max)
operation before should prevent it.

Related: #349
darrachequesne added a commit that referenced this issue Jul 10, 2022
Using a randomizationFactor value above 1 could lead to generating a
negative duration, then throwing:

> java.lang.IllegalArgumentException: delay < 0: -1012
> at java.util.Timer.schedule(Timer.java:454)
> at io.socket.client.Manager.reconnect(Manager.java:544)

This error does not seem related to a long overflow (in the
BigInteger.longValue() operation), because the BigInteger.min(this.max)
operation before should prevent it.

Related: #349

Backported from 0cbf01e
darrachequesne added a commit that referenced this issue Jul 10, 2022
Using a randomizationFactor value above 1 could lead to generating a
negative duration, then throwing:

> java.lang.IllegalArgumentException: delay < 0: -1012
> at java.util.Timer.schedule(Timer.java:454)
> at io.socket.client.Manager.reconnect(Manager.java:544)

This error does not seem related to a long overflow (in the
BigInteger.longValue() operation), because the BigInteger.min(this.max)
operation before should prevent it.

Related: #349

Backported from 0cbf01e
@darrachequesne
Copy link
Member

For future readers:

I wasn't able to reproduce, but I've added an additional guard here: 0cbf01e

Please reopen if needed.

cedev935 added a commit to cedev935/socket-java that referenced this issue Sep 14, 2023
Using a randomizationFactor value above 1 could lead to generating a
negative duration, then throwing:

> java.lang.IllegalArgumentException: delay < 0: -1012
> at java.util.Timer.schedule(Timer.java:454)
> at io.socket.client.Manager.reconnect(Manager.java:544)

This error does not seem related to a long overflow (in the
BigInteger.longValue() operation), because the BigInteger.min(this.max)
operation before should prevent it.

Related: socketio/socket.io-client-java#349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants