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 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 makes Thread.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

      public void removeAndEnsureHealthy​(InternalTestCluster cluster)
    • 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)