Skip to content

Transaction over HotRod to a server w/security enabled throws UnsupportedOperationException #14926

Closed

Description

@pferraro

Describe the bug

A transaction over HotRod to a secure remote cluster currently fails with the following:

2025-05-28 17:05:19,498 ERROR [o.i.SERVER] ISPN005003: Exception reported java.lang.UnsupportedOperationException: Decorated caches should not delegate wrapping operations
    at org.infinispan.cache.impl.DecoratedCache.rewrap(DecoratedCache.java:68)
    at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.transform(AbstractDelegatingAdvancedCache.java:238)
    at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.transform(AbstractDelegatingAdvancedCache.java:237)
    at org.infinispan.security.impl.SecureCacheImpl.transform(SecureCacheImpl.java:216)
    at org.infinispan.server.hotrod.tx.PrepareCoordinator.decorateCache(PrepareCoordinator.java:211)
    at org.infinispan.server.hotrod.TransactionRequestProcessor.prepareTransactionInternal(TransactionRequestProcessor.java:134)
    at org.infinispan.server.hotrod.TransactionRequestProcessor.lambda$prepareTransaction$0(TransactionRequestProcessor.java:68)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
    at java.base/java.lang.Thread.run(Thread.java:1583)

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

  1. Use default server configuration from the default docker image containing a local cache configured via:
{
	"local-cache" : {
		"transaction" : {
			"mode" : "NON_XA",
			"locking" : "PESSIMISTIC"
		}
	}
}
  1. Configure transactional HotRod client using TransactionMode.NON_XA and RemoteTransactionManagerLookup.getInstance().
  2. Invoke a simple RemoteCache.put(...) within a transaction.

Output of uname -a or ver

Linux P16v 6.14.7-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 22 May 2025 05:37:49 +0000 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.15" 2025-04-15 OpenJDK Runtime Environment (build 17.0.15+6) OpenJDK 64-Bit Server VM (build 17.0.15+6, mixed mode, sharing)

Infinispan version or git rev

15.2.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Impact on rolling upgrades

Fixed in released versions 16.0.10 and 16.1.4 (and later releases). While any node still runs an unfixed release, transactional Hot Rod clients against a secure cache may fail with UnsupportedOperationException — patch or upgrade all nodes before relying on them; lines older than 16.x never receive this fix.

Activity

  1. pruivo commented on May 30, 2025

    @pruivo
    Member

    Use default server configuration from the default docker image containing a local cache configured via:

    @pferraro with the default configuration, I have no issues. Are you using a local cache on the server? Is the Hot Rod client the same version?

    I can see the exception when I wrote a small embedded app that uses the withFlags() method. The method returns a DecoratedCache, which is where the exception comes from. As far as I can tell from the code, the prepare request does not set any flags.

  2. pferraro commented on May 30, 2025

    @pferraro
    ContributorAuthor

    The client code that triggered this does something like:

    tm.begin();
    var result = cache.withFlags(Flag.FORCE_RETURN_VALUE).remove(...);
    tm.commit();

    The server configuration used was:

    {
    	"local-cache" : {
    		"transaction" : {
    			"mode" : "NON_XA",
    			"locking" : "PESSIMISTIC"
    		}
    	}
    }

    The client/server versions are the same.
    The client version is 15.2.2.Final.
    The server version is "quay.io/infinispan/server:15.2", but apparently that still resolves to 15.2.1.Final.

  3. pferraro commented on Sep 5, 2025

    @pferraro
    ContributorAuthor

    This issue is still reproducible with matching 15.2.6.Final client/server versions.
    Also, this issue is not specific to a local-cache, but also affects distributed and replicated caches.

    @pruivo I neglected to mention that the cache in question has multiple decorations, e.g. cache.withDataFormat(...).withFlags(...).

  4. pruivo commented on Sep 8, 2025

    @pruivo
    Member

    I know. The DecoratedCache cannot be transformed as it expects a CacheImpl and transform() may return anything. I haven't found a clean solution; I will probably need to hack my way using ThreadLocal.

  5. pferraro commented on Apr 2, 2026

    @pferraro
    ContributorAuthor

    @pruivo Any updates? I am having a hard time seeing exactly how TX-over-HotRod could ever work, even when not using a security-realm, given that the cache on which the PrepareCoordinator operates will always be wrapped, if not by the flags applied via HotRodHeader.getOptimizedCache(...), then certainly as an EncoderCache (via org.infinispan.server.core.CacheInfo.cache(...)).

  6. self-assigned this
    on Apr 2, 2026
  7. pruivo commented on Apr 2, 2026

    @pruivo
    Member

    @pferraro I'm sorry, I thought you removed the withFlags() to work around the problem. I'll work on it after the holidays.

  8. added 3 commits that reference this issue on Apr 7, 2026
  9. added a commit that references this issue on Apr 10, 2026
  10. added a commit that references this issue on Apr 10, 2026
  11. added a commit that references this issue on Apr 13, 2026
  12. added a commit that references this issue on Apr 17, 2026
  13. pferraro commented on Apr 23, 2026

    @pferraro
    ContributorAuthor

    @pruivo Is it possible to backport this to 16.0.x?

  14. pruivo commented on Apr 23, 2026

    @pruivo
    Member

    @pruivo Is it possible to backport this to 16.0.x?

    @pferraro I've created a JIRA and asked on Zulip 👍

  15. added a commit that references this issue on Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions