[JBoss JIRA] (ISPN-8249) EvictionFunctionalTest.testSimpleExpirationMaxIdle random failure
by Radim Vansa (JIRA)
[ https://issues.jboss.org/browse/ISPN-8249?page=com.atlassian.jira.plugin.... ]
Radim Vansa reassigned ISPN-8249:
---------------------------------
Assignee: Radim Vansa
> EvictionFunctionalTest.testSimpleExpirationMaxIdle random failure
> -----------------------------------------------------------------
>
> Key: ISPN-8249
> URL: https://issues.jboss.org/browse/ISPN-8249
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 9.1.0.Final
> Reporter: Tristan Tarrant
> Assignee: Radim Vansa
> Labels: testsuite_stability
>
> java.lang.AssertionError: cache size should be zero: 0
> at org.infinispan.eviction.impl.EvictionFunctionalTest.testSimpleExpirationMaxIdle(EvictionFunctionalTest.java:93)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 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:748)
> ... Removed 16 stack frames
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 7 months
[JBoss JIRA] (ISPN-8069) Clustered Locks Embedded Mode
by Katia Aresti (JIRA)
[ https://issues.jboss.org/browse/ISPN-8069?page=com.atlassian.jira.plugin.... ]
Katia Aresti updated ISPN-8069:
-------------------------------
Status: Open (was: New)
> Clustered Locks Embedded Mode
> -----------------------------
>
> Key: ISPN-8069
> URL: https://issues.jboss.org/browse/ISPN-8069
> Project: Infinispan
> Issue Type: Feature Request
> Reporter: Katia Aresti
> Assignee: Katia Aresti
>
> h2. ClusteredLockManager and configuration
> {code:java}
> package org.infinispan.lock.api;
> public class ClusteredLockManager {
> boolean defineLock(String name, LockConfiguration configuration);
> InfinispanLock get(String name);
> LockConfiguration getConfiguration(String name);
> boolean isDefined(String name);
> CompletableFuture<Boolean> remove(String name);
> CompletableFuture<Void> reset(String name);
> }
> public class LockConfiguration {
> private final RentrancyLevel lentrancyLevel; // default NOT_REENTRANT
> private final boolean silentFailover; // default true
> // The maximum length of time for which a client can hold and renew a lock aquisition
> private final long maxLeaseTime;
> // Maximum length of time a lock may be held without updating the lease,
> // after that time any attempt to lock it will succeed
> private final long renewalLeaseTime;
> }
> public enum RentrancyLevel {
> NODE, // Node can lock if it owns the lock without blocking, only the owner node can unlock
> INSTANCE, // Instance can lock multiple times if it owns the lock without blocking, only the owner instance can unlock
> NOT_REENTRANT // Nobody can take the lock if already taken, but everybody can release it
> }
> {code}
> h4. InfinispanLock defineLock(String name, LockConfiguration configuration)
> Defines a lock with the specific name and LockConfiguration. It does not overwrite existing configurations.
> Returns true if successfully defined or false if the lock is already defined or any other failure. If silentFailover is false, then InfinispanLockException will be raised.
> h4. InfinispanLock get(String name)
> Get’s a InfinipanLock by it’s name and throws InfinispanLockException if the lock is not not defined. User must call defineLock before this method.
> h4. Optional<LockConfiguration> getConfiguration(String name);
> Get’s the configuration for a Lock. If the Lock does not exist, Optional.empty() will be returned.
> h4. boolean isDefined(String name)
> True if the lock exists, false if it doesn’t
> h4. CompletableFuture<Boolean> remove(String name)
> Removes a Lock from the system. Returns true when it was removed, false when the lock does not exist. If any other Runtime problems appear, InfinispanLockException will be raised withe the reason. As Locks are not removed automatically, so this has to be done programatically when the Lock is no longer needed. Otherwise, OutOfMemoryException could happen.
> Remove must be executed when the lock is locked, because running that without exclusive access should result in an exception. Internally, the implementation should contain generation number so that attempts to acquire a lock of a removed generation will result it exceptions in the other callers, too.
> h4. CompletableFuture<Void> reset(String name)
> Resets the lock to its initial state. If any parties are currently waiting at the lock, they will return with failure on the CompletableFuture
> h2. InfinispanLock
>
> When a cluster node holding a Lock dies, this lock is released and available for the others.
> {code:java}
> public interface InfinispanLock {
> CompletableFuture<Void> lock();
> CompletableFuture<Boolean> tryLock();
> CompletableFuture<Boolean> tryLock(long time, TimeUnit unit);
> CompletableFuture<Void> unlock();
> }
> {code}
> h4. CompletableFuture<Void> lock();
> CompletableFuture is completed successfully when the lock is acquired When a lock is aquired by a client, it will be automatically released after the maxLeaseTime specified. RenewalLeaseTime is the interval time is the time a client can aquire a lock consecutively User should set the timeouts to non-positive value The initial embedded implementation does not have to support positive values
> h4. CompletableFuture<Boolean> tryLock();
> Acquires the lock only if it is free at the time of invocation. Acquires the lock if it is available and returns with the value true. If the lock is not available then this method with the value false.
> h4. CompletableFuture<Boolean> tryLock(long time, TimeUnit unit);
> Acquires the lock if it is free within the given waiting time. If the lock is available this method returns with the value true.
> Parameters: time - the maximum time to wait for the lock unit - the time unit of the time argument Returns: true if the lock was acquired and false if the waiting time elapsed before the lock was acquired
> CompletableFuture fails with InfinispanLockException in case of error (InterruptedException, or any other non checked exceptions)
> h4. CompletableFuture<Boolean> unlock();
> If the lock is rentrant (Node or Instance), only the instance or node holding the lock will be able to unlock, otherwise, anybody can unlock and it will behave as a Semaphore with one permit. True answer will say that the operation was succesul and the lock has been released, false the lock has not been relased
> h2. Demo
> {code:java}
> public static void main(String[] args) throws Exception {
> EmbeddedCacheManager cm = Infinispan.createClustered();
> CounterManager counterManager = EmbeddedCounterManagerFactory.asCounterManager(cm);
> counterManager.defineCounter("counter", ...);
> WeakCounter counter = counterManager.weakCounter("counter");
> ClusteredLockManager lockManager = EmbeddedLockManagerFactory.asClusteredLockManager(cm);
> lockManager.defineLock("lock", ...);
> InfinispanLock lock = lockManager.get("lock");
> for (int i = 0; i < 100; i++) {
> System.out.println("Counter on " + i + " is => " + counter.getValue());
> lock.lock()
> .thenRun(new CounterExample(counter))
> .whenComplete((nil, t) -> lock.unlock());
> }
> cm.stop();
> }
> static class CounterExample implements Runnable {
> private WeakCounter counter;
> public CounterExample(WeakCounter counter) {
> this.counter = counter;
> }
> @Override
> public void run() {
> counter.increment();
> try {
> Thread.sleep(1000);
> } catch (InterruptedException e) {
> e.printStackTrace();
> }
> counter.decrement();
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 7 months
[JBoss JIRA] (ISPN-8257) BackupForStateTransferTest.testStateTransferWithClusterIdle random failures
by Radim Vansa (JIRA)
[ https://issues.jboss.org/browse/ISPN-8257?page=com.atlassian.jira.plugin.... ]
Radim Vansa updated ISPN-8257:
------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
> BackupForStateTransferTest.testStateTransferWithClusterIdle random failures
> ---------------------------------------------------------------------------
>
> Key: ISPN-8257
> URL: https://issues.jboss.org/browse/ISPN-8257
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 9.1.0.Final
> Reporter: Galder Zamarreño
> Assignee: Pedro Ruivo
> Labels: testsuite_stability
> Fix For: 9.1.1.Final
>
>
> http://ci.infinispan.org/job/Infinispan/job/master/118/testReport/junit/o...
> {code}
> java.lang.AssertionError:
> at org.infinispan.xsite.statetransfer.BackupForStateTransferTest$6.assertInCache(BackupForStateTransferTest.java:138)
> at org.infinispan.xsite.AbstractXSiteTest.assertInSite(AbstractXSiteTest.java:178)
> at org.infinispan.xsite.statetransfer.BackupForStateTransferTest.assertNoStateTransferInReceivingSite(BackupForStateTransferTest.java:133)
> at org.infinispan.xsite.statetransfer.BackupForStateTransferTest.testStateTransferWithClusterIdle(BackupForStateTransferTest.java:94)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 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:748)
> ... Removed 20 stack frames
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 7 months
[JBoss JIRA] (ISPN-8251) SoftIndexFileStoreTest.testWriteAndDeleteBatch
by Radim Vansa (JIRA)
[ https://issues.jboss.org/browse/ISPN-8251?page=com.atlassian.jira.plugin.... ]
Radim Vansa updated ISPN-8251:
------------------------------
Status: Open (was: New)
> SoftIndexFileStoreTest.testWriteAndDeleteBatch
> ----------------------------------------------
>
> Key: ISPN-8251
> URL: https://issues.jboss.org/browse/ISPN-8251
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Affects Versions: 9.1.0.Final
> Reporter: Tristan Tarrant
> Assignee: Radim Vansa
>
> org.infinispan.persistence.spi.PersistenceException: java.lang.IllegalStateException: End of file reached when reading key on 5:351
> at org.infinispan.persistence.sifs.SoftIndexFileStore.forEachOnDisk(SoftIndexFileStore.java:509)
> at org.infinispan.persistence.sifs.SoftIndexFileStore.process(SoftIndexFileStore.java:519)
> at org.infinispan.test.TestingUtil.allEntries(TestingUtil.java:1534)
> at org.infinispan.test.TestingUtil.allEntries(TestingUtil.java:1539)
> at org.infinispan.persistence.BaseStoreTest.testWriteAndDeleteBatch(BaseStoreTest.java:540)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 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:748)
> Caused by: java.lang.IllegalStateException: End of file reached when reading key on 5:351
> at org.infinispan.persistence.sifs.EntryRecord.readKey(EntryRecord.java:77)
> at org.infinispan.persistence.sifs.SoftIndexFileStore.forEachOnDisk(SoftIndexFileStore.java:476)
> ... 24 more
> ... Removed 16 stack frames
>
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 7 months
[JBoss JIRA] (ISPN-8251) SoftIndexFileStoreTest.testWriteAndDeleteBatch
by Radim Vansa (JIRA)
[ https://issues.jboss.org/browse/ISPN-8251?page=com.atlassian.jira.plugin.... ]
Radim Vansa updated ISPN-8251:
------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request: https://github.com/infinispan/infinispan/pull/5412
> SoftIndexFileStoreTest.testWriteAndDeleteBatch
> ----------------------------------------------
>
> Key: ISPN-8251
> URL: https://issues.jboss.org/browse/ISPN-8251
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Affects Versions: 9.1.0.Final
> Reporter: Tristan Tarrant
> Assignee: Radim Vansa
>
> org.infinispan.persistence.spi.PersistenceException: java.lang.IllegalStateException: End of file reached when reading key on 5:351
> at org.infinispan.persistence.sifs.SoftIndexFileStore.forEachOnDisk(SoftIndexFileStore.java:509)
> at org.infinispan.persistence.sifs.SoftIndexFileStore.process(SoftIndexFileStore.java:519)
> at org.infinispan.test.TestingUtil.allEntries(TestingUtil.java:1534)
> at org.infinispan.test.TestingUtil.allEntries(TestingUtil.java:1539)
> at org.infinispan.persistence.BaseStoreTest.testWriteAndDeleteBatch(BaseStoreTest.java:540)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 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:748)
> Caused by: java.lang.IllegalStateException: End of file reached when reading key on 5:351
> at org.infinispan.persistence.sifs.EntryRecord.readKey(EntryRecord.java:77)
> at org.infinispan.persistence.sifs.SoftIndexFileStore.forEachOnDisk(SoftIndexFileStore.java:476)
> ... 24 more
> ... Removed 16 stack frames
>
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 7 months
[JBoss JIRA] (ISPN-8247) SoftIndexFileStoreTest failures
by Radim Vansa (JIRA)
[ https://issues.jboss.org/browse/ISPN-8247?page=com.atlassian.jira.plugin.... ]
Radim Vansa closed ISPN-8247.
-----------------------------
Resolution: Duplicate Issue
> SoftIndexFileStoreTest failures
> -------------------------------
>
> Key: ISPN-8247
> URL: https://issues.jboss.org/browse/ISPN-8247
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Affects Versions: 9.1.0.Final
> Reporter: Ryan Emerson
> Assignee: Ryan Emerson
>
> Failure encountered on SoftIndexFileStore::testWriteAndDeleteBatch, however SoftIndexFileStore does not implement writeBatch, so this implies the problem can also occur with normal write operations.
> {code:java}
> org.infinispan.persistence.spi.PersistenceException: java.lang.IllegalStateException: End of file reached when reading key on 5:351
> at org.infinispan.persistence.sifs.SoftIndexFileStore.forEachOnDisk(SoftIndexFileStore.java:509)
> at org.infinispan.persistence.sifs.SoftIndexFileStore.process(SoftIndexFileStore.java:519)
> at org.infinispan.test.TestingUtil.allEntries(TestingUtil.java:1534)
> at org.infinispan.test.TestingUtil.allEntries(TestingUtil.java:1539)
> at org.infinispan.persistence.BaseStoreTest.testWriteAndDeleteBatch(BaseStoreTest.java:540)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 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:748)
> Caused by: java.lang.IllegalStateException: End of file reached when reading key on 5:351
> at org.infinispan.persistence.sifs.EntryRecord.readKey(EntryRecord.java:77)
> at org.infinispan.persistence.sifs.SoftIndexFileStore.forEachOnDisk(SoftIndexFileStore.java:476)
> ... 24 more
> ... Removed 16 stack frames
>
> {code}
> Another failure encountered with SoftIndexFileStoreTest::testOverrideWithExpirableAndCompaction
> {code:java}
> org.infinispan.persistence.spi.PersistenceException: org.infinispan.persistence.spi.PersistenceException: Index looks corrupt
> at org.infinispan.persistence.sifs.SoftIndexFileStore.load(SoftIndexFileStore.java:420)
> at org.infinispan.persistence.sifs.SoftIndexFileStoreTest.testOverrideWithExpirableAndCompaction(SoftIndexFileStoreTest.java:185)
> 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:498)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
> at org.testng.TestRunner.privateRun(TestRunner.java:767)
> at org.testng.TestRunner.run(TestRunner.java:617)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
> at org.testng.SuiteRunner.access$000(SuiteRunner.java:38)
> at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:382)
> at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.infinispan.persistence.spi.PersistenceException: Index looks corrupt
> at org.infinispan.persistence.sifs.IndexNode.applyOnLeaf(IndexNode.java:295)
> at org.infinispan.persistence.sifs.Index.getRecord(Index.java:94)
> at org.infinispan.persistence.sifs.SoftIndexFileStore.load(SoftIndexFileStore.java:414)
> ... 21 more
> Caused by: org.infinispan.persistence.sifs.IndexNode$IndexNodeOutdatedException: 12:546
> at org.infinispan.persistence.sifs.IndexNode$LeafNode.loadRecord(IndexNode.java:989)
> at org.infinispan.persistence.sifs.IndexNode$ReadOperation$1.apply(IndexNode.java:222)
> at org.infinispan.persistence.sifs.IndexNode$ReadOperation$1.apply(IndexNode.java:219)
> at org.infinispan.persistence.sifs.IndexNode.applyOnLeaf(IndexNode.java:291)
> ... 23 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 7 months
[JBoss JIRA] (ISPN-3849) Re-work ServiceLoader concepts
by Tuomas Kiviaho (JIRA)
[ https://issues.jboss.org/browse/ISPN-3849?page=com.atlassian.jira.plugin.... ]
Tuomas Kiviaho commented on ISPN-3849:
--------------------------------------
I pinpoint here that bundle providing ServiceLoader must be in state ACTIVE. Otherwise you'll end up with NPE because BundleContext will be missing.
{code}
private static <T> void addOsgiServices(Class<T> contract, Set<T> services) {
if (!Util.isOSGiContext()) {
return;
}
ClassLoader loader = ServiceFinder.class.getClassLoader();
if ((loader != null) && (loader instanceof org.osgi.framework.BundleReference)) {
final BundleContext bundleContext = ((BundleReference) loader).getBundle().getBundleContext();
final ServiceTracker<T, T> serviceTracker = new ServiceTracker<T, T>(bundleContext, contract.getName(),
null);
serviceTracker.open();
try {
final Object[] osgiServices = serviceTracker.getServices();
if (osgiServices != null) {
for (Object osgiService : osgiServices) {
services.add((T) osgiService);
}
}
} catch (Exception e) {
// ignore
}
}
}
{code}
A far better approach might be to ditch ServiceTracker altogether in favor of just handpicking the service reference because that class requires OSGi Compendium to be present and here it's not necessarily needed for what is being done.
Side note: ServiceReference objects that are also inside ServiceTracker should always be unget after service is no longer needed. Hence the open doesn't have close companion which contradicts the WhiteBoard pattern.
> Re-work ServiceLoader concepts
> ------------------------------
>
> Key: ISPN-3849
> URL: https://issues.jboss.org/browse/ISPN-3849
> Project: Infinispan
> Issue Type: Sub-task
> Components: Core
> Reporter: Brett Meyer
> Assignee: Brett Meyer
> Fix For: 7.0.0.Alpha4
>
>
> Any uses of ServiceLoader will need to be replaced by a new utility to first check OSGi services w/ SL as a fallback. This also requires that any internal services also need to be registered with OSGi (as well as external extension point impls, etc.). That's not invasive at all. OSGi blueprint files are very similar to the service loader text files in META-INF/services.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 7 months