You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/04/06 20:34:01 UTC
[GitHub] [couchdb] noahshaw11 opened a new pull request, #3987: Fix busy functions to work with pids
noahshaw11 opened a new pull request, #3987:
URL: https://github.com/apache/couchdb/pull/3987
## Overview
Fix `busy` and `restart_busy` functions to work with pids.
## Testing recommendations
## Related Issues or Pull Requests
## Checklist
- [ ] Code is written and works correctly
- [ ] Changes are covered by tests
- [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
- [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] iilyak commented on a diff in pull request #3987: Fix busy functions to work with pids
Posted by GitBox <gi...@apache.org>.
iilyak commented on code in PR #3987:
URL: https://github.com/apache/couchdb/pull/3987#discussion_r845128888
##########
src/couch/src/couch_debug.erl:
##########
@@ -281,18 +285,20 @@ help(Unknown) ->
io:format(" ---~n", []),
ok.
--spec busy(ProcessList :: [process_name()], Threshold :: pos_integer()) ->
+-spec busy([process_name()] | pid(), Threshold :: pos_integer()) ->
Review Comment:
This is not the intend. The intend is to make the following spec possible.
```
-spec busy([process_name() | pid()], Threshold :: pos_integer()) ->
[Process :: process_name() | pid()].
```
And to make it clearer and allow re-usability of a type we can define it as.
```
-type process_name() :: atom().
-type process() :: process_name() | pid().
....
-spec busy([process()], Threshold :: pos_integer()) ->
[Process :: process()].
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] iilyak commented on a diff in pull request #3987: Fix busy functions to work with pids
Posted by GitBox <gi...@apache.org>.
iilyak commented on code in PR #3987:
URL: https://github.com/apache/couchdb/pull/3987#discussion_r847525411
##########
src/couch/src/couch_debug.erl:
##########
@@ -567,22 +584,22 @@ restart(Name) ->
timeout
end.
--spec restart_busy(ProcessList :: [process_name()], Threshold :: pos_integer()) ->
+-spec restart_busy([process()], Threshold :: pos_integer()) ->
Review Comment:
We cannot support not named processes in restart_busy (due to the way restart function is implemented).
Let's keep this function as is for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] iilyak commented on a diff in pull request #3987: Fix busy functions to work with pids
Posted by GitBox <gi...@apache.org>.
iilyak commented on code in PR #3987:
URL: https://github.com/apache/couchdb/pull/3987#discussion_r847530356
##########
src/couch/src/couch_debug.erl:
##########
@@ -134,6 +137,15 @@ help(process_name) ->
- '$initial_call' key in process dictionary
- process_info(Pid, initial_call)
+ ---
+ ", []);
+help(get_pid) ->
+ io:format("
+ get_pid(Process)
+ -----------------
+
+ Get the pid for a process name.
Review Comment:
I think we need to elaborate a bit more about help message.
Something like.
```
Get the pid for a process name given either name or `pid`. When `pid` is given it returns it as is. In a sense it is just a safer alternative to `whereis/1` which wouldn't crash when `pid` is given.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] iilyak commented on a diff in pull request #3987: Fix busy functions to work with pids
Posted by GitBox <gi...@apache.org>.
iilyak commented on code in PR #3987:
URL: https://github.com/apache/couchdb/pull/3987#discussion_r847526163
##########
src/couch/src/couch_debug.erl:
##########
@@ -134,6 +137,15 @@ help(process_name) ->
- '$initial_call' key in process dictionary
- process_info(Pid, initial_call)
+ ---
+ ", []);
+help(get_pid) ->
+ io:format("
+ get_pid(Process)
Review Comment:
```get_pid(PidOrName)```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [couchdb] iilyak merged pull request #3987: Fix busy functions to work with pids
Posted by GitBox <gi...@apache.org>.
iilyak merged PR #3987:
URL: https://github.com/apache/couchdb/pull/3987
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org