You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2018/06/21 21:32:15 UTC

[couchdb] branch fix-erlang-21-eunit-failures updated (5d29224 -> 6a6a525)

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a change to branch fix-erlang-21-eunit-failures
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 5d29224  TMP: fix rebar.config.script Erlang versions
 discard b82f0d8  TMP: Point to fixed mochiweb
 discard 4796f8c  Fix use of process_info(Pid, monitored_by)
 discard 5c93d7c  Fix Mochiweb parameterized module errors
     new da9fc4c  Fix Mochiweb parameterized module errors
     new 88a57d1  Fix use of process_info(Pid, monitored_by)
     new 05d0963  TMP: Point to fixed mochiweb
     new 6a6a525  TMP: fix rebar.config.script Erlang versions

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (5d29224)
            \
             N -- N -- N   refs/heads/fix-erlang-21-eunit-failures (6a6a525)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/couch/test/couchdb_http_proxy_tests.erl | 2 ++
 src/couch/test/test_web.erl                 | 2 ++
 2 files changed, 4 insertions(+)


[couchdb] 04/04: TMP: fix rebar.config.script Erlang versions

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch fix-erlang-21-eunit-failures
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 6a6a525fd10b5199347bbbeb28d89d0bbeca7d16
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Thu Jun 21 16:28:56 2018 -0500

    TMP: fix rebar.config.script Erlang versions
---
 rebar.config.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rebar.config.script b/rebar.config.script
index ddf87cf..1bf3969 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -94,7 +94,7 @@ ErlOpts = case os:getenv("ERL_OPTS") of
 end,
 
 AddConfig = [
-    {require_otp_vsn, "R16B03|R16B03-1|17|18|19|20"},
+    {require_otp_vsn, "R16B03|R16B03-1|17|18|19|20|21"},
     {deps_dir, "src"},
     {deps, lists:map(MakeDep, DepDescs)},
     {sub_dirs, SubDirs},


[couchdb] 03/04: TMP: Point to fixed mochiweb

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch fix-erlang-21-eunit-failures
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 05d0963d72013865aec1256c09c0da809f0c4641
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Thu Jun 21 13:10:09 2018 -0500

    TMP: Point to fixed mochiweb
---
 rebar.config.script | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rebar.config.script b/rebar.config.script
index 82f4d70..ddf87cf 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -64,7 +64,8 @@ DepDescs = [
 {hyper,            "hyper",            {tag, "CouchDB-2.2.0-3"}},
 {ibrowse,          "ibrowse",          {tag, "CouchDB-4.0.1"}},
 {jiffy,            "jiffy",            {tag, "CouchDB-0.14.11-2"}},
-{mochiweb,         "mochiweb",         {tag, "v2.17.0"}},
+{mochiweb,         {url, "https://github.com/cloudant/couchdb-mochiweb"},
+                   {branch, "fix-parameterized-module-errors"}},
 {meck,             "meck",             {tag, "0.8.8"}},
 {bcrypt,           {url, "https://github.com/apache/couchdb-erlang-bcrypt"},
                    {tag, "1.0.2"}},


[couchdb] 01/04: Fix Mochiweb parameterized module errors

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch fix-erlang-21-eunit-failures
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit da9fc4c31894ccf9e60fd1239c7809dec7c766c8
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Thu Jun 21 13:02:01 2018 -0500

    Fix Mochiweb parameterized module errors
---
 src/chttpd/src/chttpd.erl                     |  3 +++
 src/chttpd/src/chttpd_db.erl                  |  3 +++
 src/chttpd/src/chttpd_external.erl            |  2 ++
 src/chttpd/src/chttpd_prefer_header.erl       | 11 ++++++-----
 src/chttpd/src/chttpd_rewrite.erl             |  3 +++
 src/chttpd/test/chttpd_prefer_header_test.erl |  7 +++++--
 src/couch/src/couch_httpd.erl                 |  3 +++
 src/couch/src/couch_httpd_auth.erl            |  5 ++++-
 src/couch/src/couch_httpd_db.erl              |  3 +++
 src/couch/src/couch_httpd_proxy.erl           |  6 ++++--
 src/couch/src/couch_httpd_rewrite.erl         | 15 +++++++++------
 src/couch/src/couch_httpd_vhost.erl           |  2 ++
 src/couch/test/couchdb_http_proxy_tests.erl   |  2 ++
 src/couch/test/test_web.erl                   |  2 ++
 src/fabric/src/fabric_doc_attachments.erl     |  2 ++
 src/fabric/src/fabric_doc_atts.erl            |  2 ++
 16 files changed, 55 insertions(+), 16 deletions(-)

diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index ae94ae6..658b63c 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -11,6 +11,9 @@
 % the License.
 
 -module(chttpd).
+
+-compile(tuple_calls).
+
 -include_lib("couch/include/couch_db.hrl").
 -include_lib("chttpd/include/chttpd.hrl").
 
diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl
index ed0adea..228ebf1 100644
--- a/src/chttpd/src/chttpd_db.erl
+++ b/src/chttpd/src/chttpd_db.erl
@@ -11,6 +11,9 @@
 % the License.
 
 -module(chttpd_db).
+
+-compile(tuple_calls).
+
 -include_lib("couch/include/couch_db.hrl").
 -include_lib("couch_mrview/include/couch_mrview.hrl").
 
diff --git a/src/chttpd/src/chttpd_external.erl b/src/chttpd/src/chttpd_external.erl
index 64664b9..fa35c6b 100644
--- a/src/chttpd/src/chttpd_external.erl
+++ b/src/chttpd/src/chttpd_external.erl
@@ -12,6 +12,8 @@
 
 -module(chttpd_external).
 
+-compile(tuple_calls).
+
 -export([handle_external_req/2, handle_external_req/3]).
 -export([send_external_response/2]).
 -export([json_req_obj_fields/0, json_req_obj/2, json_req_obj/3, json_req_obj/4]).
diff --git a/src/chttpd/src/chttpd_prefer_header.erl b/src/chttpd/src/chttpd_prefer_header.erl
index f550e80..9028e41 100644
--- a/src/chttpd/src/chttpd_prefer_header.erl
+++ b/src/chttpd/src/chttpd_prefer_header.erl
@@ -12,6 +12,7 @@
 
 -module(chttpd_prefer_header).
 
+-compile(tuple_calls).
 
 -export([
     maybe_return_minimal/2
@@ -23,9 +24,9 @@
 
 maybe_return_minimal(#httpd{mochi_req = MochiReq}, Headers) ->
     case get_prefer_header(MochiReq) of
-        "return=minimal" -> 
+        "return=minimal" ->
             filter_headers(Headers, get_header_list());
-        _ -> 
+        _ ->
             Headers
     end.
 
@@ -34,13 +35,13 @@ get_prefer_header(Req) ->
     case Req:get_header_value("Prefer") of
         Value when is_list(Value) ->
             string:to_lower(Value);
-        undefined -> 
+        undefined ->
             undefined
     end.
 
 
 filter_headers(Headers, IncludeList) ->
-    lists:filter(fun({HeaderName, _}) -> 
+    lists:filter(fun({HeaderName, _}) ->
         lists:member(HeaderName, IncludeList)
     end, Headers).
 
@@ -51,4 +52,4 @@ get_header_list() ->
 
 
 split_list(S) ->
-    re:split(S, "\\s*,\\s*", [trim, {return, list}]). 
+    re:split(S, "\\s*,\\s*", [trim, {return, list}]).
diff --git a/src/chttpd/src/chttpd_rewrite.erl b/src/chttpd/src/chttpd_rewrite.erl
index 039390e..08c9ef3 100644
--- a/src/chttpd/src/chttpd_rewrite.erl
+++ b/src/chttpd/src/chttpd_rewrite.erl
@@ -16,6 +16,9 @@
 %% @doc Module for URL rewriting by pattern matching.
 
 -module(chttpd_rewrite).
+
+-compile(tuple_calls).
+
 -export([handle_rewrite_req/3]).
 -include_lib("couch/include/couch_db.hrl").
 
diff --git a/src/chttpd/test/chttpd_prefer_header_test.erl b/src/chttpd/test/chttpd_prefer_header_test.erl
index a8a5b3d..d4fc290 100644
--- a/src/chttpd/test/chttpd_prefer_header_test.erl
+++ b/src/chttpd/test/chttpd_prefer_header_test.erl
@@ -11,6 +11,9 @@
 % the License.
 
 -module(chttpd_prefer_header_test).
+
+-compile(tuple_calls).
+
 -include_lib("couch/include/couch_db.hrl").
 -include_lib("eunit/include/eunit.hrl").
 
@@ -48,7 +51,7 @@ minimal_options_headers() ->
 
 default_no_exclude_header_test() ->
     Headers = chttpd_prefer_header:maybe_return_minimal(
-        mock_request([]), 
+        mock_request([]),
         default_headers()
         ),
     ?assertEqual(default_headers(), Headers).
@@ -67,7 +70,7 @@ empty_header_test() ->
 
 setup() ->
     ok = meck:new(config),
-    ok = meck:expect(config, get, fun("chttpd", "prefer_minimal",  _) -> 
+    ok = meck:expect(config, get, fun("chttpd", "prefer_minimal",  _) ->
         "Cache-Control, Content-Length, Content-Type, ETag, Server, Vary"
     end),
     ok.
diff --git a/src/couch/src/couch_httpd.erl b/src/couch/src/couch_httpd.erl
index 050282a..b4f01af 100644
--- a/src/couch/src/couch_httpd.erl
+++ b/src/couch/src/couch_httpd.erl
@@ -11,6 +11,9 @@
 % the License.
 
 -module(couch_httpd).
+
+-compile(tuple_calls).
+
 -include_lib("couch/include/couch_db.hrl").
 
 -export([start_link/0, start_link/1, stop/0, handle_request/5]).
diff --git a/src/couch/src/couch_httpd_auth.erl b/src/couch/src/couch_httpd_auth.erl
index 74cbe5a..21119af 100644
--- a/src/couch/src/couch_httpd_auth.erl
+++ b/src/couch/src/couch_httpd_auth.erl
@@ -11,6 +11,9 @@
 % the License.
 
 -module(couch_httpd_auth).
+
+-compile(tuple_calls).
+
 -include_lib("couch/include/couch_db.hrl").
 
 -export([party_mode_handler/1]).
@@ -148,7 +151,7 @@ proxy_authentication_handler(Req) ->
 %% @deprecated
 proxy_authentification_handler(Req) ->
     proxy_authentication_handler(Req).
-    
+
 proxy_auth_user(Req) ->
     XHeaderUserName = config:get("couch_httpd_auth", "x_auth_username",
                                 "X-Auth-CouchDB-UserName"),
diff --git a/src/couch/src/couch_httpd_db.erl b/src/couch/src/couch_httpd_db.erl
index 99b1192..220a032 100644
--- a/src/couch/src/couch_httpd_db.erl
+++ b/src/couch/src/couch_httpd_db.erl
@@ -11,6 +11,9 @@
 % the License.
 
 -module(couch_httpd_db).
+
+-compile(tuple_calls).
+
 -include_lib("couch/include/couch_db.hrl").
 
 -export([handle_request/1, handle_compact_req/2, handle_design_req/2,
diff --git a/src/couch/src/couch_httpd_proxy.erl b/src/couch/src/couch_httpd_proxy.erl
index 7e9aed7..db650da 100644
--- a/src/couch/src/couch_httpd_proxy.erl
+++ b/src/couch/src/couch_httpd_proxy.erl
@@ -11,6 +11,8 @@
 % the License.
 -module(couch_httpd_proxy).
 
+-compile(tuple_calls).
+
 -export([handle_proxy_req/2]).
 
 -include_lib("couch/include/couch_db.hrl").
@@ -38,7 +40,7 @@ handle_proxy_req(Req, ProxyDest) ->
         {error, Reason} ->
             throw({error, Reason})
     end.
-    
+
 
 get_method(#httpd{mochi_req=MochiReq}) ->
     case MochiReq:get(method) of
@@ -146,7 +148,7 @@ stream_chunked_body({stream, MReq, 0, Buf, BRem}) ->
     case CRem of
         0 ->
             BodyData = lists:reverse(Buf, Data),
-            {ok, BodyData, {trailers, MReq, [], ?PKT_SIZE}}; 
+            {ok, BodyData, {trailers, MReq, [], ?PKT_SIZE}};
         _ ->
             stream_chunked_body(
                 {stream, MReq, CRem, [Data | Buf], BRem-size(Data)}
diff --git a/src/couch/src/couch_httpd_rewrite.erl b/src/couch/src/couch_httpd_rewrite.erl
index e2a2421..a162443 100644
--- a/src/couch/src/couch_httpd_rewrite.erl
+++ b/src/couch/src/couch_httpd_rewrite.erl
@@ -16,6 +16,9 @@
 %% @doc Module for URL rewriting by pattern matching.
 
 -module(couch_httpd_rewrite).
+
+-compile(tuple_calls).
+
 -export([handle_rewrite_req/3]).
 -include_lib("couch/include/couch_db.hrl").
 
@@ -278,7 +281,7 @@ replace_var(Value, Bindings, Formats) when is_list(Value) ->
             end, [], Value));
 replace_var(Value, _Bindings, _Formats) ->
     Value.
-                    
+
 maybe_json(Key, Value) ->
     case lists:member(Key, [<<"key">>, <<"startkey">>, <<"start_key">>,
                 <<"endkey">>, <<"end_key">>, <<"keys">>]) of
@@ -321,7 +324,7 @@ format(<<"bool">>, Value) when is_list(Value) ->
         _ -> Value
     end;
 format(_Format, Value) ->
-   Value. 
+   Value.
 
 %% doc: build new patch from bindings. bindings are query args
 %% (+ dynamic query rewritten if needed) and bindings found in
@@ -337,7 +340,7 @@ make_new_path([?MATCH_ALL|_Rest], _Bindings, Remaining, Acc) ->
 make_new_path([{bind, P}|Rest], Bindings, Remaining, Acc) ->
     P2 = case couch_util:get_value({bind, P}, Bindings) of
         undefined -> << "undefined">>;
-        P1 -> 
+        P1 ->
             iolist_to_binary(P1)
     end,
     make_new_path(Rest, Bindings, Remaining, [P2|Acc]);
@@ -455,15 +458,15 @@ path_to_list([P|R], Acc, DotDotCount) ->
 
 maybe_encode_bindings([]) ->
     [];
-maybe_encode_bindings(Props) -> 
-    lists:foldl(fun 
+maybe_encode_bindings(Props) ->
+    lists:foldl(fun
             ({{bind, <<"*">>}, _V}, Acc) ->
                 Acc;
             ({{bind, K}, V}, Acc) ->
                 V1 = iolist_to_binary(maybe_json(K, V)),
                 [{K, V1}|Acc]
         end, [], Props).
-                
+
 decode_query_value({K,V}) ->
     case lists:member(K, ["key", "startkey", "start_key",
                 "endkey", "end_key", "keys"]) of
diff --git a/src/couch/src/couch_httpd_vhost.erl b/src/couch/src/couch_httpd_vhost.erl
index f23f41d..d8f9521 100644
--- a/src/couch/src/couch_httpd_vhost.erl
+++ b/src/couch/src/couch_httpd_vhost.erl
@@ -15,6 +15,8 @@
 -vsn(1).
 -behaviour(config_listener).
 
+-compile(tuple_calls).
+
 -export([start_link/0, reload/0, get_state/0, dispatch_host/1]).
 -export([urlsplit_netloc/2, redirect_to_vhost/2]).
 -export([host/1, split_host_port/1]).
diff --git a/src/couch/test/couchdb_http_proxy_tests.erl b/src/couch/test/couchdb_http_proxy_tests.erl
index d54ff15..f60ba3b 100644
--- a/src/couch/test/couchdb_http_proxy_tests.erl
+++ b/src/couch/test/couchdb_http_proxy_tests.erl
@@ -12,6 +12,8 @@
 
 -module(couchdb_http_proxy_tests).
 
+-compile(tuple_calls).
+
 -include_lib("couch/include/couch_eunit.hrl").
 
 -record(req, {method=get, path="", headers=[], body="", opts=[]}).
diff --git a/src/couch/test/test_web.erl b/src/couch/test/test_web.erl
index d568b7e..b1b3e65 100644
--- a/src/couch/test/test_web.erl
+++ b/src/couch/test/test_web.erl
@@ -13,6 +13,8 @@
 -module(test_web).
 -behaviour(gen_server).
 
+-compile(tuple_calls).
+
 -include_lib("couch/include/couch_eunit.hrl").
 
 -export([start_link/0, stop/0, loop/1, get_port/0, set_assert/1, check_last/0]).
diff --git a/src/fabric/src/fabric_doc_attachments.erl b/src/fabric/src/fabric_doc_attachments.erl
index 7c6ba66..723b9e8 100644
--- a/src/fabric/src/fabric_doc_attachments.erl
+++ b/src/fabric/src/fabric_doc_attachments.erl
@@ -12,6 +12,8 @@
 
 -module(fabric_doc_attachments).
 
+-compile(tuple_calls).
+
 -include_lib("fabric/include/fabric.hrl").
 -include_lib("couch/include/couch_db.hrl").
 
diff --git a/src/fabric/src/fabric_doc_atts.erl b/src/fabric/src/fabric_doc_atts.erl
index 7ef5dd8..a3aae80 100644
--- a/src/fabric/src/fabric_doc_atts.erl
+++ b/src/fabric/src/fabric_doc_atts.erl
@@ -12,6 +12,8 @@
 
 -module(fabric_doc_atts).
 
+-compile(tuple_calls).
+
 -include_lib("fabric/include/fabric.hrl").
 -include_lib("couch/include/couch_db.hrl").
 


[couchdb] 02/04: Fix use of process_info(Pid, monitored_by)

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch fix-erlang-21-eunit-failures
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 88a57d16ae7772b7ce18d5b1547e955f8a532358
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Thu Jun 21 16:23:32 2018 -0500

    Fix use of process_info(Pid, monitored_by)
    
    This can now return references that are from NIFs monitoring the
    process. This is important for the new file IO NIFs that monitor the
    controlling process. For now we'll just take the easy way out by
    filtering the references from our returned monitor lists.
---
 src/couch/src/couch_bt_engine.erl | 2 +-
 src/couch/src/couch_file.erl      | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/couch/src/couch_bt_engine.erl b/src/couch/src/couch_bt_engine.erl
index 43a77b0..7028997 100644
--- a/src/couch/src/couch_bt_engine.erl
+++ b/src/couch/src/couch_bt_engine.erl
@@ -185,7 +185,7 @@ decref(St) ->
 monitored_by(St) ->
     case erlang:process_info(St#st.fd, monitored_by) of
         {monitored_by, Pids} ->
-            Pids;
+            lists:filter(fun is_pid/1, Pids);
         _ ->
             []
     end.
diff --git a/src/couch/src/couch_file.erl b/src/couch/src/couch_file.erl
index 9f668ea..af06b91 100644
--- a/src/couch/src/couch_file.erl
+++ b/src/couch/src/couch_file.erl
@@ -129,7 +129,7 @@ append_term_md5(Fd, Term, Options) ->
 
 append_binary(Fd, Bin) ->
     ioq:call(Fd, {append_bin, assemble_file_chunk(Bin)}, erlang:get(io_priority)).
-    
+
 append_binary_md5(Fd, Bin) ->
     ioq:call(Fd,
         {append_bin, assemble_file_chunk(Bin, crypto:hash(md5, Bin))},
@@ -701,7 +701,8 @@ is_idle(#file{is_sys=true}) ->
     end;
 is_idle(#file{is_sys=false}) ->
     Tracker = whereis(couch_stats_process_tracker),
-    case process_info(self(), monitored_by) of
+    {monitored_by, PidsAndRefs} = process_info(self(), monitored_by),
+    case lists:filter(fun is_pid/1, PidsAndRefs) of
         {monitored_by, []} -> true;
         {monitored_by, [Tracker]} -> true;
         {monitored_by, [_]} -> exit(tracker_monitoring_failed);