Zatvobor / couch_gears

Sexy convenience for customizing your Couch DB nodes as you need
Other
15 stars 2 forks source link

`Reason: (exit) :normal` in case request body has 10K documents #72

Closed OpakAlex closed 11 years ago

OpakAlex commented 11 years ago
 [Wed, 06 Mar 2013 18:44:53 GMT] [error] [<0.13336.2>]       Conn: PUT /seed_labeled/_gears/apply_album_changes
     Reason: (exit) :normal
 Stacktrace:
   mochiweb_request.erl:146: :mochiweb_request.send/2
   mochiweb_request.erl:330: :mochiweb_request.respond/2
   /var/www/wti-sys-conf/shared/couch_gears/lib/couch_gears/mochiweb/connection.ex:140: CouchGears.Mochiweb.Connection.send/3
   /var/www/wti-sys-conf/shared/couch_gears/deps/dynamo/lib/dynamo/filters/exceptions.ex:19: Dynamo.Filters.Exceptions.service/3
   /var/www/wti-sys-conf/shared/couch_gears/lib/couch_gears/mochiweb/handler.ex:18: CouchGears.Mochiweb.Handler.call/3
   couch_httpd_db.erl:230: :couch_httpd_db.do_db_req/2
   couch_httpd.erl:317: :couch_httpd.handle_request_int/5
   mochiweb_http.erl:136: :mochiweb_http.headers/5
Zatvobor commented 11 years ago

A mochiweb_request:send/1 hides the actual {error, Reason} info (see bellow).

send(Data) ->
    case mochiweb_socket:send(Socket, Data) of
        ok ->
            ok;
        _ ->
            exit(normal)
    end.

So, In case of /_gears/apply_album_changes I believe that the actual reason is send_timeout. As a result, we should spawns dedicated process for the Changes logic.