This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload :ProxyObject, 'proxy_object.rb' | |
require 'proxy_object' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bin/jruby -S gem install atomic | |
Fetching: atomic-1.1.16-java.gem (100%) | |
Successfully installed atomic-1.1.16-java | |
1 gem installed | |
$ bin/jruby ~/tmp/rubygems_java_ext_broken.rb | |
absolute paths are broken | |
relative paths work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'json/ext' | |
NUM_THREADS = 40 | |
NUM_PARSES = 20_000 | |
def run_test(json) | |
puts Benchmark.measure { | |
threads = NUM_THREADS.times.map do | |
Thread.new do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'json/ext' | |
NUM_THREADS = 40 | |
NUM_PARSES = 20_000 | |
def run_test(json) | |
puts Benchmark.measure { | |
threads = NUM_THREADS.times.map do | |
Thread.new do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've added more comments to this code to make it more clear what | |
everything does. | |
ActiveSupport::Testing::Isolation runs its tests in parallel, and | |
JRuby has real multithreading. So, what happens under JRuby is | |
the first test executes, sets the environment variables, and | |
spawns a child process. In parallel, a second test executes, sets | |
the environment variables to different values, and spawns another | |
child process. It's this setting of environment variables that is | |
a problem - the second test is being run in parallel and sets the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is in reference to https://plus.google.com/105596541985629444566/posts/27y819XoT2V | |
to show simple steps I took to try and reproduce the described issue based upon the | |
information available. This is very simple benchmarking with an almost vanilla Rails 4 | |
application using sqlite as the database so is not useful other than to demonstrate the | |
out of the box performance with TorqueBox and Trinidad under these situations is very | |
close. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/servlet/src/test/java/io/undertow/servlet/test/streams/ServletInputStreamTestCase.java b/servlet/src/test/java/io/undertow/servlet/test/streams/ServletInputStreamTestCase.java | |
index fb00498..d423189 100644 | |
--- a/servlet/src/test/java/io/undertow/servlet/test/streams/ServletInputStreamTestCase.java | |
+++ b/servlet/src/test/java/io/undertow/servlet/test/streams/ServletInputStreamTestCase.java | |
@@ -95,6 +95,16 @@ public class ServletInputStreamTestCase { | |
//} | |
} | |
+ @Test | |
+ public void testAsyncServletInputStreamWithEmptyRequestBody() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/src/main/java/io/undertow/conduits/ChunkedStreamSinkConduit.java b/core/src/main/java/io/undertow/conduits/ChunkedStreamSinkConduit.java | |
index 1e70155..b5fb6b4 100644 | |
--- a/core/src/main/java/io/undertow/conduits/ChunkedStreamSinkConduit.java | |
+++ b/core/src/main/java/io/undertow/conduits/ChunkedStreamSinkConduit.java | |
@@ -82,7 +82,8 @@ public class ChunkedStreamSinkConduit extends AbstractStreamSinkConduit<StreamSi | |
private int state; | |
private int chunkleft = 0; | |
- private final ByteBuffer chunkingBuffer = ByteBuffer.allocate(14); //14 is the most | |
+ private final ByteBuffer chunkingBuffer = ByteBuffer.allocate(12); //12 is the most |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jubille started with: | |
# jubilee -p 8080 -e production | |
# | |
# Note that the Jubilee console outputs quite a few errors like below during | |
# the test: | |
# | |
# Jan 03, 2014 2:15:31 PM org.vertx.java.core.logging.impl.JULLogDelegate error | |
# SEVERE: Unhandled exception | |
# java.nio.channels.ClosedChannelException |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run lambda { |env| | |
[200, { 'Content-Type' => 'text/plain' }, ["hello world\n"]] | |
} |