Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
# Used to generate regionName.java
# usage: ./generate_regionName.pl > ../source/com/maxmind/geoip/regionName.java
use strict;
use warnings;
print <<__JAVA_CODE__;
package com.maxmind.geoip;
"qtp24742184-57" prio=10 tid=0x00007f12ec044000 nid=0x4935 runnable [0x00007f12ea854000]
java.lang.Thread.State: RUNNABLE
at scala.concurrent.forkjoin.LinkedTransferQueue.size(LinkedTransferQueue.java:701)
at overlock.threadpool.InstrumentedThreadPoolExecutor$$anonfun$1.apply$mcI$sp(InstrumentedThreadPoolExecutor.scala:37)
at overlock.threadpool.InstrumentedThreadPoolExecutor$$anonfun$2.apply$mcI$sp(InstrumentedThreadPoolExecutor.scala:37)
at overlock.threadpool.InstrumentedThreadPoolExecutor$$anonfun$2.apply(InstrumentedThreadPoolExecutor.scala:37)
at overlock.threadpool.InstrumentedThreadPoolExecutor$$anonfun$2.apply(InstrumentedThreadPoolExecutor.scala:37)
at com.yammer.metrics.scala.MetricsGroup$$anon$1.value(MetricsGroup.scala:21)
at com.yammer.metrics.reporting.MetricsServlet.evaluateGauge(MetricsServlet.java:360)
at com.yammer.metrics.reporting.MetricsServlet.processGauge(MetricsServlet.java:313)
$ sudo mcelog
mcelog: Unsupported new Family 6 Model 2c CPU: only decoding architectural errors
HARDWARE ERROR. This is *NOT* a software problem!
Please contact your hardware vendor
MCE 0
CPU 0 BANK 8
MISC 26cd3a4000010e89 ADDR 50f3bb3c0
TIME 1341786001 Sun Jul 8 22:20:01 2012
MCG status:
MCi status:
@cscotta
cscotta / Repro.scala
Created June 30, 2012 19:00
scala.concurrent.forkjoin.LinkedTransferQueue hazard in .size()
import java.util.concurrent.CountDownLatch
import java.util.concurrent.atomic.AtomicLong
//import jsr166y.LinkedTransferQueue
import scala.concurrent.forkjoin.LinkedTransferQueue
// Queue and the object we'll repeatedly insert
val obj = new Object
val q = new LinkedTransferQueue[Object]
cscotta@ordasity:~/Desktop$ scala -cp mongo-2.7.0.jar Repro.scala
Inserting canary...
Inserting test data...
Paging through records...
Spotted the canary!
Updating canary object...
Spotted the canary!
Whoops, shipped the same order multiple times!
cscotta@ordasity:~/Desktop$
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo</groupId>
<artifactId>bar</artifactId>
<version>0.1.8</version>
import com.yammer.metrics.Meter
import com.twitter.zookeeper.ZooKeeperClient
import com.boundary.ordasity.{Cluster, ClusterConfig, SmartListener}
class MyService {
val config = new ClusterConfig("localhost:2181")
val cluster = new Cluster("ServiceName", listener, config)
val listener = new SmartListener {
Sampling process 2474 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Mou (pid 2474) every 1 millisecond
Process: Mou [2474]
Path: /Applications/Mou.app/Contents/MacOS/Mou
Load Address: 0x1733cc000
Identifier: com.mouapp.Mou
Version: 0.6.5 (0.6.5)
Code Type: X86-64 (Native)
Parent Process: launchd [204]
Process: Mou [88121]
Path: /Applications/Mou.app/Contents/MacOS/Mou
Identifier: com.mouapp.Mou
Version: 0.6.3 (0.6.3)
Code Type: X86-64 (Native)
Parent Process: launchd [201]
Date/Time: 2011-10-11 14:11:49.183 -0700
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6
2011-10-05_18:24:18.89887 ERROR [2011-10-05 18:24:18,898] kafka.utils.Utils$: java.nio.channels.ClosedByInterruptException
2011-10-05_18:24:18.89888 ! java.nio.channels.ClosedByInterruptException
2011-10-05_18:24:18.89888 ! at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:184)
2011-10-05_18:24:18.89889 ! at sun.nio.ch.FileChannelImpl.force(FileChannelImpl.java:352)
2011-10-05_18:24:18.89889 ! at kafka.message.FileMessageSet.flush(FileMessageSet.scala:172)
2011-10-05_18:24:18.89889 ! at kafka.log.Log.flush(Log.scala:307)
2011-10-05_18:24:18.89890 ! at kafka.log.LogManager$$anonfun$kafka$log$LogManager$$flushAllLogs$1.apply(LogManager.scala:269)
2011-10-05_18:24:18.89890 ! at kafka.log.LogManager$$anonfun$kafka$log$LogManager$$flushAllLogs$1.apply(LogManager.scala:260)
2011-10-05_18:24:18.89891 ! at scala.collection.Iterator$class.foreach(Iterator.scala:631)
2011-10-05_18:24:18.89892 ! at kafka.utils.IteratorTemplate.foreach(IteratorTemplate.scala:29)