Skip to content

Instantly share code, notes, and snippets.

@timcharper
timcharper / README.md
Created June 16, 2017 18:09
Strange deadlock issue

We have encountered a strange deadlock scenario in which it appears that all threads are waiting on acquiring a ReentrantLock, but no thread has the lock. A scan of the above thread dump reveals that all threads are stuck on Lock.scala:7, which is as follows:

/Users/tim/src/m8e/marathon-1.4/src/main/scala/mesosphere/marathon/util/Lock.scala

   1 | package mesosphere.marathon.util
   2 | 
   3 | import java.util.concurrent.locks.{ ReentrantLock, ReentrantReadWriteLock }
   4 | 
 5 | class RichLock(private val lock: ReentrantLock) extends AnyVal {
package org.ensime.util
import akka.actor.Scheduler
import java.time.Clock
import java.util.concurrent.atomic.{ AtomicBoolean, AtomicInteger }
import org.slf4j.LoggerFactory
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
/**
@timcharper
timcharper / thread-dump-2.txt
Created May 4, 2017 20:29
ensime-server-issue-1770-thread-dump
2017-05-04 14:20:43
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.112-b16 mixed mode):
"*** Profiler Agent Special Execution Thread 8" #82 daemon prio=10 os_prio=31 tid=0x00007faf82aa2800 nid=0x9f0b runnable [0x0000700008e5d000]
java.lang.Thread.State: RUNNABLE
at org.netbeans.lib.profiler.server.system.Classes.doRedefineClasses(Native Method)
at org.netbeans.lib.profiler.server.system.Classes.redefineClasses(Classes.java:149)
at org.netbeans.lib.profiler.server.ProfilerInterface.redefineClasses(ProfilerInterface.java:1289)
at org.netbeans.lib.profiler.server.ProfilerInterface.instrumentMethodGroupNow(ProfilerInterface.java:1221)
@timcharper
timcharper / thread-dump-2.txt
Created May 4, 2017 20:29
ensime-server-issue-1770-thread-dump
2017-05-04 14:20:43
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.112-b16 mixed mode):
"*** Profiler Agent Special Execution Thread 8" #82 daemon prio=10 os_prio=31 tid=0x00007faf82aa2800 nid=0x9f0b runnable [0x0000700008e5d000]
java.lang.Thread.State: RUNNABLE
at org.netbeans.lib.profiler.server.system.Classes.doRedefineClasses(Native Method)
at org.netbeans.lib.profiler.server.system.Classes.redefineClasses(Classes.java:149)
at org.netbeans.lib.profiler.server.ProfilerInterface.redefineClasses(ProfilerInterface.java:1289)
at org.netbeans.lib.profiler.server.ProfilerInterface.instrumentMethodGroupNow(ProfilerInterface.java:1221)
@timcharper
timcharper / test.sc
Created March 15, 2017 22:06
demonstrates the https AbruptTerminationException issue (requires ammonite)
#!/usr/bin/env amm
import $ivy.`com.typesafe.akka::akka-http:10.0.4`
import akka.actor._
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.{ HttpRequest, Uri }
import akka.stream._
import scala.concurrent.duration._
import scala.concurrent.Await
import scala.util.control.NonFatal
marathon [2017-02-21 20:45:09,573] DEBUG Got ping response for sessionid: 0x15a62d1d1590037 after 1ms (org.apache.zookeeper.ClientCnxn:pool-3-thread-1-SendThread(mesos-1.dev.vagrant:2181))
marathon [2017-02-21 20:45:09,712] DEBUG queryForAppId /le-sleep (mesosphere.marathon.core.appinfo.impl.DefaultInfoService:qtp1013728905-40)
marathon [2017-02-21 20:45:09,712] DEBUG new AppInfoBaseData mesosphere.marathon.core.appinfo.impl.AppInfoBaseData@55dafed5 (mesosphere.marathon.core.appinfo.impl.AppInfoBaseData$:qtp1013728905-40)
marathon [2017-02-21 20:45:09,712] DEBUG Retrieving running deployments (mesosphere.marathon.core.appinfo.impl.AppInfoBaseData$:ForkJoinPool-2-worker-17)
marathon [2017-02-21 20:45:09,713] DEBUG calculating task counts for app [/le-sleep] (mesosphere.marathon.core.appinfo.impl.AppInfoBaseData$:ForkJoinPool-2-worker-15)
marathon [2017-02-21 20:45:09,713] DEBUG Retrieve tasks (mesosphere.marathon.core.appinfo.impl.AppInfoBaseData$:ForkJoinPool-2-worker-15)
marathon [2017-02-21 20:45:09,713] DE
@timcharper
timcharper / Makefile
Last active January 9, 2017 13:32
Jenkins tests stats
.PHONY: default all download clean purge
default: all
JOB=public-marathon-unstable
AUTH:=
ifneq ($(AUTH),)
AUTH_ARGS:=--user "$(AUTH)"
endif
FETCH_COMMAND:=curl $(AUTH_ARGS) "https://jenkins.mesosphere.com/service/jenkins/view/Marathon/job/$(JOB)/api/json?pretty=true&allBuilds=true" | jq '.builds | map(.number | tostring) | .[1:] | join(" ")' -r
IDS:=$(shell $(FETCH_COMMAND))
@timcharper
timcharper / leader.sc
Last active January 8, 2017 02:33
Ammonite scala script showing leader election
#!/usr/bin/env amm
import $ivy.`org.apache.curator:curator-recipes:2.11.0`
import java.util.concurrent.Executors
import org.apache.zookeeper.KeeperException.{ NoNodeException, NodeExistsException }
import org.apache.curator.framework.CuratorFrameworkFactory
import org.apache.curator.retry.ExponentialBackoffRetry
import org.apache.curator.framework.recipes.leader.LeaderLatch
import org.apache.curator.framework.recipes.leader.LeaderLatchListener
import scala.util.Random
@timcharper
timcharper / CHANGELOG-1.4.0-RC2.md
Last active December 13, 2016 00:06
1.4.0-RC2 Changlog
@timcharper
timcharper / fixed-via.sh
Last active July 10, 2016 22:44
mesos build 1.0.0-rc2 output
# this allowed configure to complete (building tag 1.0.0-rc2)
for f in src/python/native/ext_modules.py.in bin/mesos-slave-flags.sh.in bin/mesos-slave.sh.in bin/gdb-mesos-slave.sh.in bin/lldb-mesos-slave.sh.in bin/valgrind-mesos-slave.sh.in src/deploy/mesos-start-slaves.sh.in src/deploy/mesos-stop-slaves.sh.in; do
git show c81a52ec22266e1f2beb61b224c0f0d9be82521f^:$f > $f
done