Class LongGCDisruption
java.lang.Object
org.elasticsearch.test.disruption.SingleNodeDisruption
org.elasticsearch.test.disruption.LongGCDisruption
- All Implemented Interfaces:
ServiceDisruptionScheme
- Direct Known Subclasses:
IntermittentLongGCDisruption
public class LongGCDisruption extends SingleNodeDisruption
Suspends all threads on the specified node in order to simulate a long gc.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
disruptedNode
Fields inherited from class org.elasticsearch.test.disruption.SingleNodeDisruption
cluster, logger, random
-
Constructor Summary
Constructors Constructor Description LongGCDisruption(java.util.Random random, java.lang.String disruptedNode)
-
Method Summary
Modifier and Type Method Description org.elasticsearch.common.unit.TimeValue
expectedTimeToHeal()
protected long
getBlockDetectionIntervalInMillis()
protected long
getSuspendingTimeoutInMillis()
protected java.util.regex.Pattern[]
getUnsafeClasses()
boolean
isBlockDetectionSupported()
boolean
isDisruptedNodeThread(java.lang.String threadName)
protected void
onBlockDetected(java.lang.management.ThreadInfo blockedThread, java.lang.management.ThreadInfo blockingThread)
void
removeAndEnsureHealthy(InternalTestCluster cluster)
protected void
resumeThreads(java.util.Set<java.lang.Thread> threads)
boolean
sawSlowSuspendBug()
Checks if during disruption we ran into a known JVM issue that makesThread.suspend()
calls block for multiple seconds was observed.void
startDisrupting()
void
stopDisrupting()
protected boolean
suspendThreads(java.util.Set<java.lang.Thread> nodeThreads)
resolves all threads belonging to given node and suspends them if their current stack trace is "safe".Methods inherited from class org.elasticsearch.test.disruption.SingleNodeDisruption
applyToCluster, applyToNode, ensureNodeCount, removeFromCluster, removeFromNode, testClusterClosed
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
disruptedNode
protected final java.lang.String disruptedNode
-
-
Constructor Details
-
LongGCDisruption
public LongGCDisruption(java.util.Random random, java.lang.String disruptedNode)
-
-
Method Details
-
sawSlowSuspendBug
public boolean sawSlowSuspendBug()Checks if during disruption we ran into a known JVM issue that makesThread.suspend()
calls block for multiple seconds was observed.- Returns:
- true if during thread suspending a call to
Thread.suspend()
took more than 3s - See Also:
- JDK-8218446
-
startDisrupting
public void startDisrupting() -
isDisruptedNodeThread
public boolean isDisruptedNodeThread(java.lang.String threadName) -
stopDisrupting
public void stopDisrupting() -
removeAndEnsureHealthy
-
expectedTimeToHeal
public org.elasticsearch.common.unit.TimeValue expectedTimeToHeal() -
suspendThreads
protected boolean suspendThreads(java.util.Set<java.lang.Thread> nodeThreads)resolves all threads belonging to given node and suspends them if their current stack trace is "safe". Threads are added to nodeThreads if suspended. returns true if some live threads were found. The caller is expected to call this method until no more "live" are found. -
getUnsafeClasses
protected java.util.regex.Pattern[] getUnsafeClasses() -
getSuspendingTimeoutInMillis
protected long getSuspendingTimeoutInMillis() -
isBlockDetectionSupported
public boolean isBlockDetectionSupported() -
getBlockDetectionIntervalInMillis
protected long getBlockDetectionIntervalInMillis() -
onBlockDetected
protected void onBlockDetected(java.lang.management.ThreadInfo blockedThread, @Nullable java.lang.management.ThreadInfo blockingThread) -
resumeThreads
protected void resumeThreads(java.util.Set<java.lang.Thread> threads)
-