IllegalArgumentException: bound must be greater than origin

See original GitHub issue

During long time running of service, exception is thrown: java.lang.IllegalArgumentException: bound must be greater than origin

Expected behavior

No exception

Actual behavior

java.lang.IllegalArgumentException: bound must be greater than origin

Stacktrace, unfortunately due to our logging (kibana), those are not in order:

		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.Filter$$anon$3.apply(Filter.scala:104) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.Filter$$anon$3.apply(Filter.scala:104) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactory.apply(ServiceFactory.scala:27) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.redis.BaseClient.doRequest(Client.scala:103) ~[finagle-redis_2.12-18.12.0.jar:18.12.0]
		at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[netty-common-4.1.31.Final.jar:4.1.31.Final]
		at com.twitter.finagle.util.BlockingTimeTrackingThreadFactory$$anon$1.run(BlockingTimeTrackingThreadFactory.scala:23) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.Filter$$anon$3.apply(Filter.scala:104) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.FactoryToService.apply(FactoryToService.scala:12) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.redis.KeyCommands.dels(KeyCommands.scala:19) ~[finagle-redis_2.12-18.12.0.jar:18.12.0]
		at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[netty-common-4.1.31.Final.jar:4.1.31.Final]
		at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:335) ~[netty-transport-native-epoll-4.1.31.Final-linux-x86_64.jar:4.1.31.Final]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.factory.TimeoutFactory.apply(TimeoutFactory.scala:63) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_181]
		at com.twitter.finagle.redis.KeyCommands.dels$(KeyCommands.scala:18) ~[finagle-redis_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.redis.Client.dels(Client.scala:26) ~[finagle-redis_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_181]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) ~[netty-common-4.1.31.Final.jar:4.1.31.Final]
		at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.31.Final.jar:4.1.31.Final]
		at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.loadbalancer.TrafficDistributor.apply(TrafficDistributor.scala:308) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.service.Retries$$anon$1.applySelf(Retries.scala:277) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.util.Rng$$anon$2.nextInt(Rng.scala:69) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.util.Drv$Aliased.apply(Drv.scala:37) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
	java.lang.IllegalArgumentException: bound must be greater than origin
		at com.twitter.finagle.loadbalancer.TrafficDistributor$Distributor.apply(TrafficDistributor.scala:90) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.factory.TimeoutFactory.apply(TimeoutFactory.scala:63) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.util.Drv$Aliased.apply(Drv.scala:32) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.factory.RefcountedFactory.apply(RefcountedFactory.scala:23) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.service.Retries$$anon$1.apply(Retries.scala:319) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.Filter$$anon$3.apply(Filter.scala:104) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
	java.lang.IllegalArgumentException: bound must be greater than origin
		at com.twitter.finagle.factory.StatsFactoryWrapper.apply(StatsFactoryWrapper.scala:42) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.Filter$$anon$3.apply(Filter.scala:104) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.filter.RequestLogger$$anon$1.apply(RequestLogger.scala:55) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
		at com.twitter.finagle.ServiceFactoryProxy.apply(ServiceFactoryProxy.scala:15) ~[finagle-core_2.12-18.12.0.jar:18.12.0]

This exception originates from:

at com.twitter.finagle.util.Drv$Aliased.apply(Drv.scala:37) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
at com.twitter.finagle.util.Rng$$anon$2.nextInt(Rng.scala:69) ~[finagle-core_2.12-18.12.0.jar:18.12.0]
at java.util.concurrent.ThreadLocalRandom.nextInt(ThreadLocalRandom.java:378) ~[?:1.8.0_181]

Steps to reproduce the behavior

Not sure since this happens quite rarely. This started to happen after update to finagle+finatra 18.12 from 18.06

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
szysascommented, May 23, 2019

@luciferous Thanks for fix! (sorry, I only now noticed you reply)

0reactions
luciferouscommented, Feb 7, 2019

@szysas Keep us posted if you manage to test this with your service.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved - java.lang.IllegalArgumentException: bound must ...
I don't think it's because bound is smaller than origin, I think it's because bound is equal to origin. Bound is exclusive, meaning...
Read more >
Why am I receiving "bound must be positive" error?
IllegalArgumentException : bound must be positive at java.util.Random.nextInt(Random.java:388). Whenever bound is zero or negative , it is an ...
Read more >
[Fixed] IllegalArgumentException: Bound must be positive
In this post, we will see how to fix IllegalArgumentException: Bound must be positive in java. You will generally get this exception while...
Read more >
Java ThreadLocalRandom nextInt() Method with Examples
This method returns the next value. Exception: IllegalArgumentException - This exception will throw if the least is greater than or equal to bound....
Read more >
What is wrong with my code?
I keep getting a weird error. Exception in thread "main" java.lang.IllegalArgumentException: bound must be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found