Skip to content

Commit 0305f4c

Browse files
committed
Bug 38041090 - Failed to restart services: java.lang.SecurityException due to Subject is not inherited from the parent thread, fix test failure (14.1.2.0 cl 117466 --> 14.1.2.0 CE)
[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v14.1.2.0/": change = 117512]
1 parent 369b357 commit 0305f4c

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

prj/test/functional/processor/src/main/java/processor/AbstractDistEntryProcessorTests.java

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2+
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -296,7 +296,7 @@ public void asyncBacklog()
296296
AsynchronousProcessor[] aAsync = new AsynchronousProcessor[COUNT];
297297
for (int i = 0; true; i++)
298298
{
299-
EntryProcessor proc = new UpdaterProcessor((ValueUpdater) null,
299+
EntryProcessor proc = new UpdateProcessorForBacklog((ValueUpdater) null,
300300
Integer.valueOf(Base.getRandom().nextInt()));
301301
AsynchronousProcessor async = new AsynchronousProcessor(proc, i);
302302

@@ -327,6 +327,7 @@ public synchronized void proceed(Object o)
327327

328328
if (async.checkBacklog(contNormal))
329329
{
330+
m_fBackLogAnnounced = true;
330331
log("Backlog announced " + i);
331332

332333
async.flush();
@@ -663,5 +664,53 @@ public Object process(Entry entry)
663664
return ctx.getBackingMapEntry(binKey).getValue();
664665
}
665666
}
667+
668+
/**
669+
* An UpdaterProcessor that ensures backlog.
670+
*/
671+
public static class UpdateProcessorForBacklog<K, V, T>
672+
extends UpdaterProcessor<K, V, T>
673+
{
674+
/**
675+
* Default constructor (necessary for the ExternalizableLite interface).
676+
*/
677+
public UpdateProcessorForBacklog()
678+
{
679+
}
680+
681+
public UpdateProcessorForBacklog(ValueUpdater<V, T> updater, T value)
682+
{
683+
super(updater, value);
684+
}
685+
686+
@Override
687+
public Boolean process(InvocableMap.Entry<K, V> entry)
688+
{
689+
ValueUpdater<V, T> updater = m_updater;
690+
691+
// if there isn't backlog, sleep to slow down
692+
if (!m_fBackLogAnnounced)
693+
{
694+
Base.sleep(100);
695+
}
696+
697+
if (updater == null)
698+
{
699+
//NOTE: a possibly unsafe cast from T to V
700+
entry.setValue((V) m_value, false);
701+
}
702+
else if (entry.isPresent())
703+
{
704+
entry.update(updater, m_value);
705+
}
706+
else
707+
{
708+
return Boolean.FALSE;
709+
}
710+
return Boolean.TRUE;
711+
}
712+
}
713+
714+
private static boolean m_fBackLogAnnounced = false;
666715
}
667716

0 commit comments

Comments
 (0)