Commits

Anonymous committed 847b0dc

more logging

Comments (0)

Files changed (2)

src/emongo_packet.erl

 			  Documents:DocLen/binary,
 			  Tail/binary>> = Message,
 			Resp = #response{
-				header = {header, Length, ReqID, RespTo, Op}, 
+				header = #header{message_length = Length,
+                                                 request_id = ReqID,
+                                                 response_to = RespTo,
+                                                 op_code = Op},
 				response_flag = RespFlag, 
 				cursor_id = CursorID, 
 				offset = StartingFrom, 

src/emongo_pool.erl

 %%                                       {stop, Reason, State}
 %% Description: Handling all non call/cast messages
 %%--------------------------------------------------------------------
-handle_info({'EXIT', Pid, _Reason}, #pool{conn_pid=Pids}=State) ->
+handle_info({'EXIT', Pid, Reason}, #pool{conn_pid=Pids}=State) ->
+    error_logger:error_msg("Pool ~p deactivated by worker death: ~p~n'", [State#pool.id, Reason]),
+    
     Pids1 = queue:filter(fun(Item) -> Item =/= Pid end, Pids),
     {noreply, State#pool{conn_pid = Pids1, active=false}};
 
             PacketLast = emongo_packet:get_last_error(Database, ReqId),
             case catch emongo_server:send_recv(Pid, ReqId, PacketLast, ?POLL_TIMEOUT) of
                 {'EXIT', Reason} ->
-                    error_logger:error_msg("Pool ~p deactivated: ~p~n'", [Pool#pool.id, Reason]),
+                    error_logger:error_msg("Pool ~p deactivated by polling: ~p~n'", [Pool#pool.id, Reason]),
                     NewPool#pool{active=false};
                 _ ->
                     NewPool#pool{active=true}