Skip to content

Instantly share code, notes, and snippets.

View ldaley's full-sized avatar

Luke Daley ldaley

View GitHub Profile
import static org.ratpackframework.groovy.RatpackScript.ratpack
ratpack {
handlers {
handler {
if (request.path.empty || request.path == "index.html") {
response.addHeader "X-UA-Compatible", "IE=edge,chrome=1"
}
next()
}
task assembleAllAsciidoc(type: Copy) {
into "$buildDir/asciidoc"
allprojects {
from project.asciidoc // assuming the asciidoc task correctly declares its outputs
into project.name // subdir is the name of the project
}
}
tomcatRun {
gradle.taskGraph.whenReady {
if (it.hasTask(test)) {
daemon = true
}
}
}
test {
dependsOn tomcatRun
@ldaley
ldaley / gist:6163301
Created August 6, 2013 10:03
Netty stack trace.
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:218)
at sun.nio.ch.IOUtil.read(IOUtil.java:186)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:359)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:275)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:867)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:227)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:87)
@ldaley
ldaley / gist:6163331
Created August 6, 2013 10:11
Netty trace (2)
Aug 06, 2013 11:10:33 AM io.netty.util.ResourceLeakDetector reportLeak
WARNING: LEAK: ByteBuf was GC'd before being released correctly. The following stack trace shows where the leaked object was created, rather than where you failed to release it.
io.netty.util.ResourceLeakException: io.netty.buffer.CompositeByteBuf@17d936e4
at io.netty.util.ResourceLeakDetector$DefaultResourceLeak.<init>(ResourceLeakDetector.java:174)
at io.netty.util.ResourceLeakDetector.open(ResourceLeakDetector.java:116)
at io.netty.buffer.CompositeByteBuf.<init>(CompositeByteBuf.java:60)
at io.netty.buffer.Unpooled.compositeBuffer(Unpooled.java:353)
at io.netty.handler.codec.http.HttpObjectAggregator.decode(HttpObjectAggregator.java:138)
at io.netty.handler.codec.http.HttpObjectAggregator.decode(HttpObjectAggregator.java:50)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89)
/*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software