summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2021-02-05 14:02:43 +0000
committerRobert Newson <rnewson@apache.org>2021-02-09 22:02:56 +0000
commit776f3683205bfaa7c41b24137bfb07b7487dabe0 (patch)
tree99cffcdccd8df4b02698b2342e54e29789ff3dc6
parent44a13d5aeb5b1766c23f00e035915d79ab478a61 (diff)
downloadcouchdb-active-tasks-process-status.tar.gz
Show process status in active_tasksactive-tasks-process-status
This allows users to verify that compaction processes are suspended outside of any configured strict_window.
-rw-r--r--src/couch/src/couch_task_status.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/couch/src/couch_task_status.erl b/src/couch/src/couch_task_status.erl
index 4083c3f81..74247d63d 100644
--- a/src/couch/src/couch_task_status.erl
+++ b/src/couch/src/couch_task_status.erl
@@ -124,7 +124,7 @@ handle_call({add_task, TaskProps}, {From, _}, Server) ->
end;
handle_call(all, _, Server) ->
All = [
- [{pid, ?l2b(pid_to_list(Pid))} | TaskProps]
+ [{pid, ?l2b(pid_to_list(Pid))}, process_status(Pid) | TaskProps]
||
{Pid, TaskProps} <- ets:tab2list(?MODULE)
],
@@ -160,3 +160,12 @@ timestamp() ->
timestamp({Mega, Secs, _}) ->
Mega * 1000000 + Secs.
+
+
+process_status(Pid) ->
+ case process_info(Pid, status) of
+ undefined ->
+ {process_status, exiting};
+ {status, Status} ->
+ {process_status, Status}
+ end.