Skip to content

Conversation

@pavel-jares-bcm
Copy link
Contributor

@pavel-jares-bcm pavel-jares-bcm commented Nov 28, 2025

Description

This PR fixes a couple of issues:

  1. Configuration of Infinispan

The original configuration was for replicated cache, even the aim is to have distuributed one.

  1. Split storage

The caches could be split on level on data and index configuration. This fix change it in the way as v3 is working to split even there is no configuration (by HA instance name). It requires less configuration and work on each platform.

  1. Exception handling

In the original implementation are all exception handling only in one way, there is no way that any unexpected excetion is thrown. As the resutlt the responses are incorrect and missleading, for example:

  • if there is a timeout exception during first attempt to obtain salt the code continue as there is no record and tries to generate new salt. It leads to an error 409 key conflict.
  • an unexcepted error duting synchronization of all map method (to obtain the whole cache content) leads to error message that the storage does not support the method (like infinispan is not used) even it is not true. In this case it was just and issue about serialiazation of lambda because if was not serializable.
  1. Service was not starting

It the service tried to generate any record during the startup (when cluster was not established) it leads to failing start up. The Zowe Launcher then restart the whole service and it happened again. The solution is to not create a lock bean immediatelly but on the demand.

  1. Do not store salt

Because there was many of issue we decided to do not cache salt and read it always from the Infinispan. It also required a small refactoring to use the same cache during multiple operation (see validation of PAT).

  1. Log messages update

There are new log messages to detect a reason of failing service and debug profile was extended for Infinispan (till now it was focused only on JGroup).

  1. Method to get all map or all record on a specific map does not work

In case of connected cluster the function for obtaing data fails because it required to serialize lambda (see lamba during collection to get key and value from the cache).


Other know errors (a separated issues will be created):

  • Key exchange endpoint ignores truststore

It is solveble for v3, but not for v2 (a different version of Infinispan). The key exchange implementation uses a private key from keystore and needs to trust the oposite site. Therefore the public certificate must be in the keyring otherwise the cluster cannot be established.

  • Loading of salt is not an atomic operation

In the case the state of cache is not distibuted, obtaining of the cache is not working. It tries to read from instance A and create in instance B. The instance B could contain a salt and it would lead to 409 key conflict.

If multiple instances at same time tries to read salt one should fail. It would be solved by a lock, It would be callable from the Gateway.

  • Gateway calls the caching service through itselft

Each call from the Gateway is routed and it means each request is targeting on a different instance of Caching service (see the issue with obtaining salt). The optimal solution would be to use local instance of Caching service (deterministic routing cannot be used because in case local instance is down it is not trying to use other instance). Because the methods use methods POST, DELETE, etc. it is no trying to retry calls. The best solution would be to use load balanced client and do not call Gateway itself.

  • Storage is identified by DN from client certificate

When multiple services uses the same client certificate the caches are not split (not exclusive for a specific service).

Changing of certificate (in case of modification of DN) Gateway (ZAAS) will forget for all revoked tokens and they could be used again.

  • Validation of PAT

For each validation of any PAT is Gateway asking for the whole cache. It means all records, including irrelevant ones are transfered to the Gateway. It means the original aim to safe calls works only with empty (or almost empty) cache. Since the data are growing the payload is growing as well and it could lead to service failure.

The optimum solution is to ask for concreate records (a batch call) or includ cache inside the Gateway.

  • No PAT is removed

Because there is stored just hash of PAT and no other information it is not possible identify if storing a token is still required (it is basically required till the token expired). It means the database is growing without any limitation. It especially with downloading the whole database is not optimal.

The data sould be marked with a flag, that allows to remove old records then. Ideally to set expiration of a record.

  • Address to bind is not configurable

It is not possible to define a IP address to bind the main port to be listening on.

  • Exception handling

The condition to detect original reason is very fragile. Everything uses the same type of exception, only its properties are set.

It would be also benefitial to start using exception handler instead of handle them in the controller.

  • A client provide client certificate and X-Certificate-DistinguishedName

Those values are not checked if matching. Client with any request could call the caching service and provide any value. Their usage is also questionable.

  • Heatlh endpoint does not respect state of JGroups

Even the service claims it is up we have no information about cluster. The state of JGroup communication does not effect the service state and we cannot determinate it. The diag endpoint was disabled to mitigate a potential security issue.


If there is a lack of communication, caching service could fails during the start-up. It was happenning of 3-instances set up.

This implementation tries to create lock at the moment when is needed and just response 503, because there is no Spring bean that should be created.

 2025-11-27 14:38:18.465 �[35m<ZWEACS1:main:17040669>�[0;39m ZWESVUSR �[33mWARN �[0;39m �[36m(o.a.c.l.WebappClassLoaderBase)�[0;39m The web application [cachingservice] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
  sun.misc.Unsafe.park(Native Method)
...
  java.lang.Thread.run(Thread.java:821)
 2025-11-27 14:38:18.466 �[35m<ZWEACS1:main:17040669>�[0;39m ZWESVUSR �[33mWARN �[0;39m �[36m(o.a.c.l.WebappClassLoaderBase)�[0;39m The web application [cachingservice] appears to have started a thread named [pollingConfigurationSource] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
  sun.misc.Unsafe.park(Native Method)
  java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
  java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2089)
  java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1104)
  java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:820)
  java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1085)
  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  java.lang.Thread.run(Thread.java:821)
 Exception in thread "main" java.lang.reflect.InvocationTargetException
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
 	at java.lang.reflect.Method.invoke(Method.java:508)
 	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
 	at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
 	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
 	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
 Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cachingController' defined in URL [jar:file:/***/components/caching-service/bin/caching-service.jar!/BOOT-INF/classes!/org/zowe/apiml/caching/api/CachingController.class]: Unsatisfied dependency expressed through co
 nstructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'storage' defined in class path resource [org/zowe/apiml/caching/service/infinispan/config/InfinispanConfig.class]: Unsatisfied dependency expressed through method 'storage' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lock' defined in class path resource [org/zow
 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:794)
 	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:220)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591)
 	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
 	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
 	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
 	at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
 	at org.zowe.apiml.caching.CachingService.main(CachingService.java:36)
 	... 8 more
 Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'storage' defined in class path resource [org/zowe/apiml/caching/service/infinispan/config/InfinispanConfig.class]: Unsatisfied dependency expressed through method 'storage' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lock' defined in class path resource [org/zowe/apiml/caching/service/infinisp
 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(Cons
 tructorResolver.java:794)
 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:532)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
 	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
 	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904)
 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:781)
 	... 25 more
 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lock' defined in class path resource [org/zowe/apiml/caching/service/infinispan/config/InfinispanConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.infinispan.lock.api.ClusteredLock]: Factory method 'lock' threw exception; nested exception is org.infinispan.partitionha
 	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:646)
 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:626)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
 	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
 	at org.springframew
 ork.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904)
 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:781)
 	... 39 more
 Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.infinispan.lock.api.ClusteredLock]: Factory method 'lock' threw exception; nested exception is org.infinispan.partitionhandling.AvailabilityException: ISPN000306: Key 'ClusteredLockKey{name=zoweInvalidatedTokenLock}' is not available. Not all owners are in this partition
 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
 	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:641)
 	... 53 more
 Caused by: org.infinispan.partitionhandling.AvailabilityException: ISPN000306: Key 'ClusteredLockKey{name=zoweInvalidatedTokenLock}' is not available. Not all owners are in this partition
 	at org.infinispan.partitionhandling.impl.PartitionHandlingManagerImpl.doCheck(PartitionHandlingManagerImpl.java:266)
 	at org.infinispan.partitionhandling.impl.PartitionHandlingManagerImpl.checkWrite(PartitionHandlingManagerImpl.java:98)
 	at org.infinispan.partitionhandling.impl.PartitionHandlingInterceptor.handleSingleWrite(PartitionHandlingInterceptor.java:90)
 	at org.infinispan.partitionhandling.impl.PartitionHandlingInterceptor.visitPutKeyValueCommand(PartitionHandlingInterceptor.java:55)
 	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
 	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNextAndHandle(BaseAsyncInterceptor.java:188)
 	at org.infinispan.statetransfer.StateTransferInterceptor.handleNonTxWriteCommand(StateTransferInterceptor.java:312)
 	at org.infinispan.statetransfer.StateTransferInterceptor.handleWriteCommand(StateTransferInterceptor.java:256)
 	at org.infinispan.statetransfer.StateTransferInterceptor.visitPutKeyValueCommand(StateTransferInterceptor.java:96)
 	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
 	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
 	at org.infinispan.interceptors.impl.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:265)
 	at org.infinispan.interceptors.impl.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:224)
 	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
 	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:59)
 	at org.infinispan.interceptors.DDAsyncInterceptor.handleDefault(DDAsyncInterceptor.java:55)
 	at org.infinispan.interceptors.DDAsyncInterceptor.visitPutKeyValueCommand(DDAsyncInterceptor.java:61)
 	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
 	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNextAndExceptionally(BaseAsyncInterceptor.java:128)
 	at org.infinispan.interceptors.impl.InvocationContextInterceptor.visitCommand(InvocationContextInterceptor.java:89)
 	at org.infinispan.interceptors.BaseAsyncInterceptor.invokeNext(BaseAsyncInterceptor.java:61)
 	at org.infinispan.interceptors.DDAsyncInterceptor.handleDefault(DDAsyncInterceptor.java:55)
 	at org.infinispan.interceptors.DDAsyncInterceptor.visitPutKeyValueCommand(DDAsyncInterceptor.java:61)
 	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:63)
 	at org.infinispan.interceptors.DDAsyncInterceptor.visitCommand(DDAsyncInterceptor.java:51)
 	at org.infinispan.interceptors.impl.AsyncInterceptorChainImpl.invoke(AsyncInterceptorChainImpl.java:247)
 	at org.infinispan.cache.impl.InvocationHelper.doInvoke(InvocationHelper.java:297)
 	at org.infinispan.cache.impl.InvocationHelper.invoke(InvocationHelper.java:101)
 	at org.infinispan.cache.impl.InvocationHelper.invoke(InvocationHelper.java:83)
 	at org.infinispan.cache.impl.CacheImpl.putIfAbsent(CacheImpl.java:1339)
 	at or
 g.infinispan.cache.impl.DecoratedCache.putIfAbsent(DecoratedCache.java:688)
 	at org.infinispan.cache.impl.DecoratedCache.putIfAbsent(DecoratedCache.java:593)
 	at org.infinispan.cache.impl.AbstractDelegatingCache.putIfAbsent(AbstractDelegatingCache.java:349)
 	at org.infinispan.cache.impl.AbstractDelegatingCache.putIfAbsent(AbstractDelegatingCache.java:349)
 	at org.infinispan.cache.impl.AbstractDelegatingCache.putIfAbsent(AbstractDelegatingCache.java:349)
 	at org.infinispan.cache.impl.AbstractDelegatingCache.putIfAbsent(AbstractDelegatingCache.java:349)
 	at org.infinispan.cache.impl.AbstractDelegatingCache.putIfAbsent(AbstractDelegatingCache.java:349)
 	at org.infinispan.cache.impl.EncoderCache.putIfAbsent(EncoderCache.java:490)
 	at org.infinispan.lock.impl.manager.EmbeddedClusteredLockManager.defineLock(EmbeddedClusteredLockManager.java:108)
 	at org.infinispan.lock.impl.manager.EmbeddedClusteredLockManager.defineLock(EmbeddedClusteredLockManager.java:99)
 	at org.zowe.apiml.caching.service.infinispan.config.InfinispanConfig.lock(InfinispanConfig.java:114)
 	at org.zowe.apiml.caching.service.infinispan.config.InfinispanConfig$$EnhancerBySpringCGLIB$$19a6c406.CGLIB$lock$2(<generated>)
 	at org.zowe.apiml.caching.service.infinispan.config.InfinispanConfig$$EnhancerBySpringCGLIB$$19a6c406$$FastClassBySpringCGLIB$$8af372f5.invoke(<generated>)
 	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
 	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
 	at org.zowe.apiml.caching.service.infinispan.config.InfinispanConfig$$EnhancerBySpringCGLIB$$19a6c406.lock(<generated>)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
 	at java.lang.reflect.Method.invoke(Method.java:508)
 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
 	... 54 more
 bos extend currSize=0x0 dataSize=0x1a80 chunk=0x1000 extend=0x1a80
 2025-11-27 14:36:59 <ZWELS:17040644> ZWESVUSR INFO (zwe-internal-start-component) starting component caching-service ...

Exception during getAll operation:

org.infinispan.commons.marshall.MarshallingException: java.lang.NoSuchMethodException: org.zowe.apiml.caching.service.infinispan.storage.InfinispanStorage$$Lambda$2483/0x0000000000000000.writeReplace()
	at org.infinispan.marshall.core.LambdaMarshaller.write(LambdaMarshaller.java:25)
	at org.infinispan.marshall.core.GlobalMarshaller.writeUnknownLambda(GlobalMarshaller.java:613)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:381)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:351)
	at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
	at org.infinispan.stream.impl.intops.IntermediateOperationExternalizer.writeObject(IntermediateOperationExternalizer.java:246)
	at org.infinispan.stream.impl.intops.IntermediateOperationExternalizer.writeObject(IntermediateOperationExternalizer.java:93)
	at org.infinispan.marshall.core.GlobalMarshaller.writeInternal(GlobalMarshaller.java:655)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:370)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:351)
	at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
	at org.infinispan.commons.marshall.MarshallUtil.marshallCollection(MarshallUtil.java:254)
	at org.infinispan.commons.marshall.MarshallUtil.marshallCollection(MarshallUtil.java:232)
	at org.infinispan.marshall.exts.CollectionExternalizer.writeObject(CollectionExternalizer.java:76)
	at org.infinispan.marshall.exts.CollectionExternalizer.writeObject(CollectionExternalizer.java:28)
	at org.infinispan.marshall.core.GlobalMarshaller.writeInternal(GlobalMarshaller.java:655)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:370)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:351)
	at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
	at org.infinispan.stream.impl.CacheStreamIntermediateReducer$ReducerExternalizer.writeObject(CacheStreamIntermediateReducer.java:54)
	at org.infinispan.stream.impl.CacheStreamIntermediateReducer$ReducerExternalizer.writeObject(CacheStreamIntermediateReducer.java:51)
	at org.infinispan.marshall.core.GlobalMarshaller.writeInternal(GlobalMarshaller.java:655)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:370)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:351)
	at org.infinispan.marshall.core.BytesObjectOutput.writeObject(BytesObjectOutput.java:26)
	at org.infinispan.reactive.publisher.impl.commands.reduction.ReductionPublisherRequestCommand.writeTo(ReductionPublisherRequestCommand.java:110)
	at org.infinispan.marshall.exts.ReplicableCommandExternalizer.writeCommandParameters(ReplicableCommandExternalizer.java:84)
	at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.marshallParameters(CacheRpcCommandExternalizer.java:158)
	at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.writeObject(CacheRpcCommandExternalizer.java:154)
	at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.writeObject(CacheRpcCommandExternalizer.java:88)
	at org.infinispan.marshall.core.GlobalMarshaller.writeInternal(GlobalMarshaller.java:655)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNonNullableObject(GlobalMarshaller.java:370)
	at org.infinispan.marshall.core.GlobalMarshaller.writeNullableObject(GlobalMarshaller.java:351)
	at org.infinispan.marshall.core.GlobalMarshaller.writeObjectOutput(GlobalMarshaller.java:180)
	at org.infinispan.marshall.core.GlobalMarshaller.writeObjectOutput(GlobalMarshaller.java:173)
	at org.infinispan.marshall.core.GlobalMarshaller.objectToBuffer(GlobalMarshaller.java:301)
	at org.infinispan.remoting.transport.jgroups.JGroupsTransport.marshallRequest(JGroupsTransport.java:1138)
	at org.infinispan.remoting.transport.jgroups.JGroupsTransport.sendCommand(JGroupsTransport.java:1126)
	at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeCommand(JGroupsTransport.java:960)
	at org.infinispan.remoting.rpc.RpcManagerImpl.invokeCommand(RpcManagerImpl.java:178)
	at org.infinispan.reactive.publisher.impl.ClusterPublisherManagerImpl.startSegmentPublisher(ClusterPublisherManagerImpl.java:354)
	at org.infinispan.reactive.publisher.impl.ClusterPublisherManagerImpl.reduction(ClusterPublisherManagerImpl.java:180)
	at org.infinispan.reactive.publisher.impl.ClusterPublisherManagerImpl.entryReduction(ClusterPublisherManagerImpl.java:161)
	at org.infinispan.stream.impl.AbstractCacheStream.performPublisherOperation(AbstractCacheStream.java:204)
	at org.infinispan.stream.impl.DistributedCacheStream.collect(DistributedCacheStream.java:285)
	at org.infinispan.util.AbstractDelegatingCacheStream.collect(AbstractDelegatingCacheStream.java:280)
	at org.zowe.apiml.caching.service.infinispan.storage.InfinispanStorage.getAllMaps(InfinispanStorage.java:105)
	at org.zowe.apiml.caching.api.CachingController.lambda$getAllMaps$3(CachingController.java:148)
	at java.util.Optional.map(Optional.java:215)
	at org.zowe.apiml.caching.api.CachingController.getAllMaps(CachingController.java:145)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:503)
	at com.netflix.hystrix.contrib.javanica.command.MethodExecutionAction.execute(MethodExecutionAction.java:116)
	at com.netflix.hystrix.contrib.javanica.command.MethodExecutionAction.executeWithArgs(MethodExecutionAction.java:93)
	at com.netflix.hystrix.contrib.javanica.command.MethodExecutionAction.execute(MethodExecutionAction.java:78)
	at com.netflix.hystrix.contrib.javanica.command.GenericCommand$1.execute(GenericCommand.java:48)
	at com.netflix.hystrix.contrib.javanica.command.AbstractHystrixCommand.process(AbstractHystrixCommand.java:145)
	at com.netflix.hystrix.contrib.javanica.command.GenericCommand.run(GenericCommand.java:45)
	at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302)
	at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298)
	at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)
	at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
	at rx.Observable.unsafeSubscribe(Observable.java:10327)
	at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51)
	at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
	at rx.Observable.unsafeSubscribe(Observable.java:10327)
	at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
	at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
	at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
	at rx.Observable.unsafeSubscribe(Observable.java:10327)
	at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100)
	at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction$1.call(HystrixContexSchedulerAction.java:56)
	at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction$1.call(HystrixContexSchedulerAction.java:47)
	at com.netflix.hystrix.strategy.concurrency.HystrixContexSchedulerAction.call(HystrixContexSchedulerAction.java:69)
	at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:826)
Caused by: java.lang.NoSuchMethodException: org.zowe.apiml.caching.service.infinispan.storage.InfinispanStorage$$Lambda$2483/0x0000000000000000.writeReplace()
	at java.lang.Class.newNoSuchMethodException(Class.java:570)
	at java.lang.Class.throwExceptionOrReturnNull(Class.java:1295)
	at java.lang.Class.getMethodHelper(Class.java:1392)
	at java.lang.Class.getDeclaredMethod(Class.java:969)
	at org.infinispan.marshall.core.SecurityActions.getMethodAndSetAccessible(SecurityActions.java:29)
	at org.infinispan.marshall.core.SecurityActions.getMethodAndSetAccessible(SecurityActions.java:25)
	at org.infinispan.marshall.core.LambdaMarshaller.write(LambdaMarshaller.java:21)
	... 89 more

Linked to # (issue)
Part of the # (epic)

Type of change

Please delete options that are not relevant.

  • fix: Bug fix (non-breaking change which fixes an issue)
  • feat: New feature (non-breaking change which adds functionality)
  • docs: Change in a documentation
  • refactor: Refactor the code
  • chore: Chore, repository cleanup, updates the dependencies.
  • BREAKING CHANGE or !: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the style guidelines of this project
  • PR title conforms to commit message guideline ## Commit Message Structure Guideline
  • I have commented my code, particularly in hard-to-understand areas. In JS I did provide JSDoc
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The java tests in the area I was working on leverage @nested annotations
  • Any dependent changes have been merged and published in downstream modules

For more details about how should the code look like read the Contributing guideline

return clm.get("zoweInvalidatedTokenLock");
} catch (AvailabilityException ae) {
log.debug("Cannot obtain lock", ae);
throw new StorageException(Messages.CACHE_NOT_AVAILABLE.getKey(), Messages.CACHE_NOT_AVAILABLE.getStatus());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should include at least the exception message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message is there. I didn't want to improve exception handling, but I will create an issue about.

Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
type: WARNING
text: "Cache is not available: %s"
reason: "Cache is not ready to write at the moment."
action: "Verify the instance configuration or connectivity between multiple instances."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is expected to be resolved during runtime, should the message rather contain: "wait for initialization"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message was updated

@EvaJavornicka EvaJavornicka moved this from New to In Progress in API Mediation Layer Backlog Management Dec 3, 2025
pavel-jares-bcm and others added 10 commits December 3, 2025 10:31
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
…oot/caching-error-on-lock

# Conflicts:
#	apiml-common/src/main/java/org/zowe/apiml/product/eureka/client/ApimlPeerEurekaNode.java
#	caching-service/src/main/java/org/zowe/apiml/caching/service/infinispan/config/InfinispanConfig.java
#	caching-service/src/main/resources/application.yml
@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 3, 2025
@github-actions github-actions bot added the Sensitive Sensitive change that requires peer review label Dec 3, 2025
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
…ervice: Temporary failure in name resolution)

Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
Signed-off-by: Pavel Jareš <[email protected]>
@pavel-jares-bcm pavel-jares-bcm changed the title fix not to stop caching service during the start-up because of a conn… fix: Fix infinispan configuration, exception handling, and the whole cache operation Dec 12, 2025
Signed-off-by: Pavel Jareš <[email protected]>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
76.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Sensitive Sensitive change that requires peer review size/XL

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants