Skip to content

Instantly share code, notes, and snippets.

def write(msg : Any) : ChannelFuture = {
queueLock.readLock {
if (!drained) {
val future = Channels.future(channelRef.get)
queue.offer((future,msg))
future
} else {
channelRef.get.write(msg) <-- NPE here
}
}
commit d59a596838ff94c01e17a1a0c7164727e2638169
Author: Robert Newson <robert.newson@cloudant.com>
Date: 2012-08-09 14:05:02 +0100
Don't always require exactly N replies for an mp attachment PUT
It's not safe to assume we require, or will receive, exactly N replies
(where N is read from the "n" key of the "cluster" section of the
configuaration). This needs proper fabric-ification.
➜ ~ curl -sv localhost:5984/_session -Hcontent-type:application/json -d '{"name":"admin","password":"foobar"}'
* About to connect() to localhost port 5984 (#0)
* Trying ::1...
* Connection refused
* Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 5984 (#0)
> POST /_session HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:5984
Mar 29 19:18:53 10.57.51.132 local5: 2013-03-29 19:18:53,378 scalang.node.ErlangHandler [INFO] channel disconnected org.jboss.netty.channel.DefaultChannelPipeline$Def
aultChannelHandlerContext@28784295 [id: 0x56ed2e2f, /127.0.0.1:41174 :> /127.0.0.1:46685] DISCONNECTED. peer: null
Mar 29 19:18:53 10.57.51.132 local5: 2013-03-29 19:18:53,378 scalang.node.ServerHandshakeHandler [ERROR] Channel closed during handshake
Mar 29 19:19:00 10.57.51.132 local5: 2013-03-29 19:19:00,388 scalang.node.ServerHandshakeHandler [ERROR] Exception caught during erlang handshake:
Mar 29 19:19:00 java.lang.NullPointerException
Mar 29 19:19:00 10.57.51.132 at scalang.node.ErlangConnection.connectRequested(ErlangConnection.scala:130)
Mar 29 19:19:00 10.57.51.132 at scalang.ErlangNode.registerConnection(Node.scala:454)
Mar 29 19:19:00 10.57.51.132 at scalang.node.HandshakeHandler.setPeer(HandshakeHandler.scala:54)
Mar 29 19:19:00 10.57.51.132 at scalang.node.ServerHandshakeHandler.receiveName(ServerHandshakeHandler.sc
diff --git a/src/couchdb/couch_view_group.erl b/src/couchdb/couch_view_group.erl
index 5f83c05..4a653b5 100644
--- a/src/couchdb/couch_view_group.erl
+++ b/src/couchdb/couch_view_group.erl
@@ -600,7 +600,7 @@ sum_btree_sizes(nil, _) ->
null;
sum_btree_sizes(_, nil) ->
null;
-sum_btree_sizes(Size1, Size2) ->
+sum_btree_sizes(Size1, Size2) when is_integer(Size1), is_integer(Size2) ->
diff --git a/src/mochiweb_http.erl b/src/mochiweb_http.erl
index 7607b30..354c6b1 100644
--- a/src/mochiweb_http.erl
+++ b/src/mochiweb_http.erl
@@ -162,6 +162,8 @@ after_response(Body, Req) ->
?MODULE:loop(Socket, Body)
end.
+parse_range_request("bytes=0-") ->
+ undefined;
--95e02eeeedcd0b0f670999f2d00a9e5f^M
Content-Type: application/json^M
^M
{"_id":"bar","_rev":"3-36e5f66bfc95d3cf9768a66819bb6cbe","_attachments":{"att3":{"content_type":"application/octet-stream","revpos":3,"digest":"md5-afqrYmg1ApVVDefVh7wyPQ==","length":7,"fo\
llows":true},"att1":{"content_type":"text/plain","revpos":2,"digest":"md5-iMaiC8wqiFlD2NjLTemvCQ==","length":5,"follows":true,"encoding":"gzip","encoded_length":25},"att2":{"content_type":\
"text/plain","revpos":1,"digest":"md5-iMaiC8wqiFlD2NjLTemvCQ==","length":5,"follows":true,"encoding":"gzip","encoded_length":25}}}^M
--95e02eeeedcd0b0f670999f2d00a9e5f^M
Content-Disposition: attachment; filename="att3"^M
Content-Type: application/octet-stream^M
Content-Length: 7^M
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index 8189761..2c003f9 100644
--- a/src/couchdb/couch_server.erl
+++ b/src/couchdb/couch_server.erl
@@ -429,6 +429,7 @@ handle_info({'EXIT', _Pid, config_change}, Server) ->
handle_info({'EXIT', Pid, Reason}, Server) ->
Server2 = case ets:lookup(couch_dbs_by_pid, Pid) of
[{Pid, Db}] ->
+ ?LOG_INFO("pid: ~p, db: ~p", [Pid, Db]),
DbName = Db#db.name,
➜ ~ curl -sv localhost:5984/db1/doc1 -XPUT -H"Expect: 100-continue" -d '{}'
* About to connect() to localhost port 5984 (#0)
* Trying ::1...
* Connection refused
* Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 5984 (#0)
> PUT /db1/doc1 HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5
> Host: localhost:5984
@rnewson
rnewson / preseed.txt
Created June 19, 2013 14:52
Basic hands-free Debian install. Do adjust the password and maybe you need to tweak the disk stuff too.
d-i debian-installer/locale string en_US
d-i console-keymaps-at/keymap select us
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/choose_interface select auto
d-i netcfg/wireless_wep string
d-i mirror/country string manual
d-i mirror/http/hostname string http.debian.net
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i passwd/root-login boolean false