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/10/17 18:32:17 UTC

[GitHub] [couchdb] nickva opened a new pull request, #4230: Avoid refresh messages piling up in prometheus server

nickva opened a new pull request, #4230:
URL: https://github.com/apache/couchdb/pull/4230

   Previously, the cast `refresh` message didn't explicitly cancel the previous timer. If a `gen_server:call(Server, refresh)` was made and a `refresh` message was already in the message queue, it was possible to end up with two parallel refresh periods (cycles): one with the regular refresh period, the other generated by the regular refresh gen_server call.
   
   In addition, drain all the previous refresh messages before scheduling a new timer. This should further help lower the chance of refresh cycles piling up on top of each other.
   
   The fix is mostly theoretical as technically I don't think anything triggers a `refresh` gen_server:call/2 calls in practice. It would have to be a manual or an externally scripted call.
   


-- 
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] nickva commented on pull request #4230: Avoid refresh messages piling up in prometheus server

Posted by GitBox <gi...@apache.org>.
nickva commented on PR #4230:
URL: https://github.com/apache/couchdb/pull/4230#issuecomment-1281306608

   A way to test it could be:
   
   ```
   (node1@127.0.0.1)5> lists:foreach(fun(_) -> gen_server:call(couch_prometheus_server, refresh) end, lists:seq(1, 500)).
   ok
   (node1@127.0.0.1)6> erlang:process_info(whereis(couch_prometheus_server)).
   [{registered_name,couch_prometheus_server},
   ...
    {message_queue_len,286},
   ```


-- 
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] nickva commented on pull request #4230: Avoid refresh messages piling up in prometheus server

Posted by GitBox <gi...@apache.org>.
nickva commented on PR #4230:
URL: https://github.com/apache/couchdb/pull/4230#issuecomment-1281425761

   @jaydoane great idea to add tests, will do so!
   


-- 
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] nickva merged pull request #4230: Avoid refresh messages piling up in prometheus server

Posted by GitBox <gi...@apache.org>.
nickva merged PR #4230:
URL: https://github.com/apache/couchdb/pull/4230


-- 
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