ClassLoader issues when using Redisson Transactions with asynchronously acquired RedissonClient
See original GitHub issueExpected behavior
When using an asynchronously acquired RedissonClient (via. CompletableFuture.supplyAsync
) with transactions I expect the class loader used to be correct.
Some constraints to narrow the scope of the problem:
- I only encountered this when using Redisson Transactions.
- If the client was acquired in a synchronous way, I did not see this behavior.
Actual behavior
Similar to #2984 I am seeing that on the first request to my WAR on a web server, the correct class loader is used.
But then on subsequent requests, it is using the URLClassPath loader what I assume to be the default for Jetty.
After this breaks, I get consistent ClassNotFound errors.
Steps to reproduce or test case I created a minimal jetty project here in an effort to reproduce the code we are running.
In words, my steps were as follows:
Create a Jetty Server running 9.4.30.v20200611
, and deploy a WAR on it. Place objects into Redis, using transactions, and try to retrieve them. After the first request succeeds, observe ClassNotFound issues when trying to retrieve other objects. The stack trace can be found in a gist.
Redis version 6.0.5
Redisson version 13.15.1
Redisson configuration
redissonConfig
.useSingleServer()
.setConnectTimeout(10_000)
.setTimeout(10_000)
.setRetryAttempts(0)
.setConnectionPoolSize(20)
.setConnectionMinimumIdleSize(1)
.setPassword("SECRET")
.setAddress("redis://host.docker.internal:6379");
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
That fixed it! Thanks!
set
useThreadClassLoader
=false
in configuration.