Skip to content

Commit fcabe89

Browse files
committed
Log missing_ets_data errors; fix wait_for_session_timeout typo
1 parent 59af6dc commit fcabe89

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/elysium_bs_serial.erl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ fetch_pid_from_queue( Config, Session_Queue, Max_Retries, Times_Tried) ->
178178
case ets_buffer:read_dedicated(Session_Queue) of
179179

180180
%% Race condition with checkin, try again...
181-
%% (Internally, ets_buffer calls erlang:yield() when this happens)
182-
{missing_ets_data, Session_Queue, _} ->
181+
%% (When this happens, a connection is left behind in the queue and will never get reused!)
182+
{missing_ets_data, Session_Queue, Read_Loc} ->
183+
lager:error("Missing ETS data reading ~p at location ~p~n", [Session_Queue, Read_Loc]),
183184
fetch_pid_from_queue(Config, Session_Queue, Max_Retries, Times_Tried+1);
184185

185186
%% Give up if there are no connections available...
@@ -370,9 +371,9 @@ checkin_pending(Config, Node, Sid, Pending_Queue, Is_New_Connection) ->
370371
case ets_buffer:read_dedicated(Pending_Queue) of
371372

372373
%% Race condition with pend_request, try again...
373-
%% (Internally, ets_buffer calls erlang:yield() when this happens)
374-
%% (It is presumed that repeated calling will eventually yield something even [])
375-
{missing_ets_data, Pending_Queue, _} ->
374+
%% (When this happens, a pending request is left behind in the queue and will timeout)
375+
{missing_ets_data, Pending_Queue, Read_Loc} ->
376+
lager:error("Missing ETS data reading ~p at location ~p~n", [Pending_Queue, Read_Loc]),
376377
checkin_pending(Config, Node, Sid, Pending_Queue, Is_New_Connection);
377378

378379
%% There are no pending requests, return the session...

src/elysium_connection.erl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ start_channel( Config, Lb_Queue_Name, Max_Retries, Times_Tried, Attempted_Conne
8787
case ets_buffer:read_dedicated(Lb_Queue_Name) of
8888

8989
%% Race condition with another user, try again...
90-
%% (Internally, ets_buffer calls erlang:yield() when this happens)
91-
{missing_ets_data, Lb_Queue_Name, _} ->
90+
%% (When this happens, a cassandra node is left out permanently!)
91+
{missing_ets_data, Lb_Queue_Name, Read_Loc} ->
92+
lager:error("Missing ETS data reading ~p at location ~p~n", [Lb_Queue_Name, Read_Loc]),
9293
start_channel(Config, Lb_Queue_Name, Max_Retries, Times_Tried+1, Attempted_Connections);
9394

9495
%% Give up if there are no connections available...
@@ -174,7 +175,7 @@ buffer_bare_fun_call( Config, Session_Fun, Args, Consistency, serial) ->
174175
handle_bare_fun_reply({Err_Type, _Err_Data} = Error, Mod, Fun, Args)
175176
when Err_Type =:= missing_ets_data;
176177
Err_Type =:= missing_ets_buffer;
177-
Err_Type =:= wait_for_session_time;
178+
Err_Type =:= wait_for_session_timeout;
178179
Err_Type =:= worker_reply_error;
179180
Err_Type =:= worker_reply_timeout ->
180181
report_error(Error, Mod, Fun, Args);
@@ -213,7 +214,7 @@ buffer_mod_fun_call( Config, Mod, Fun, Args, Consistency, serial) ->
213214
handle_mod_fun_reply({Err_Type, _Err_Data} = Error, Mod, Fun, Args)
214215
when Err_Type =:= missing_ets_data;
215216
Err_Type =:= missing_ets_buffer;
216-
Err_Type =:= wait_for_session_time;
217+
Err_Type =:= wait_for_session_timeout;
217218
Err_Type =:= worker_reply_error;
218219
Err_Type =:= worker_reply_timeout ->
219220
report_error(Error, Mod, Fun, Args);

0 commit comments

Comments
 (0)