You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/07/27 14:04:01 UTC

[GitHub] [incubator-pegasus] empiredan commented on a diff in pull request #1074: feat: support to close percentile to prevent from heap-use-after-free error

empiredan commented on code in PR #1074:
URL: https://github.com/apache/incubator-pegasus/pull/1074#discussion_r931105112


##########
src/rdsn/include/dsn/utility/metrics.h:
##########
@@ -168,6 +171,16 @@ class metric_entity : public ref_counter
 
     ~metric_entity();
 
+    // Close all "closeable" metrics owned by this entity.
+    //
+    // `async` is used to control if the close operations are asynchronous or not. It is set to
+    // true by default, which means all metrics owned by this entity will be closed asynchronously
+    // without waiting for the close operations to be finished.
+    //
+    // Otherwise, once `async` is set to false, close() will be blocked until the close operations
+    // are finished.
+    void close(bool async = true);

Review Comment:
   OK, we can use enum class instead.



-- 
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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org