You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2021/09/08 06:29:40 UTC

[GitHub] [celix] pnoltes opened a new pull request #360: Feature/promise timeout memleak

pnoltes opened a new pull request #360:
URL: https://github.com/apache/celix/pull/360


   This PR mainly updates documentation that promises need to be resolved to avoid memory leaks.
   
   It also:
    - Adds a setTimeout method on Promise which can be used to set the timeout of the current promises, creating a new associated promise with a timeout. This is not part of the OSGi spec, but helps in ensuring that all promises will eventually resolve.
    - Updates the `resolveWith` method to return a Promise<void> as described in the OSGi spec.
    - Fixes an issue when cancelling a ScheduledFuture.
    - Updated some - but not yet all - of the doxygen 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: dev-unsubscribe@celix.apache.org

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



[GitHub] [celix] pnoltes merged pull request #360: Feature/promise timeout memleak

Posted by GitBox <gi...@apache.org>.
pnoltes merged pull request #360:
URL: https://github.com/apache/celix/pull/360


   


-- 
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@celix.apache.org

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



[GitHub] [celix] codecov-commenter commented on pull request #360: Feature/promise timeout memleak

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #360:
URL: https://github.com/apache/celix/pull/360#issuecomment-914962300


   # [Codecov](https://codecov.io/gh/apache/celix/pull/360?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#360](https://codecov.io/gh/apache/celix/pull/360?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cdb4ed4) into [master](https://codecov.io/gh/apache/celix/commit/2430b07fcd30d24654ca96c838e4809107a056dd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2430b07) will **increase** coverage by `0.10%`.
   > The diff coverage is `87.02%`.
   
   > :exclamation: Current head cdb4ed4 differs from pull request most recent head 87456ec. Consider uploading reports for the commit 87456ec to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/celix/pull/360/graphs/tree.svg?width=650&height=150&src=pr&token=JdsiThga8P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/celix/pull/360?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #360      +/-   ##
   ==========================================
   + Coverage   71.48%   71.59%   +0.10%     
   ==========================================
     Files         201      203       +2     
     Lines       34793    34966     +173     
   ==========================================
   + Hits        24872    25033     +161     
   - Misses       9921     9933      +12     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/celix/pull/360?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [libs/promises/api/celix/IScheduledExecutor.h](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9wcm9taXNlcy9hcGkvY2VsaXgvSVNjaGVkdWxlZEV4ZWN1dG9yLmg=) | `100.00% <ø> (ø)` | |
   | [.../promises/api/celix/PromiseIllegalStateException.h](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9wcm9taXNlcy9hcGkvY2VsaXgvUHJvbWlzZUlsbGVnYWxTdGF0ZUV4Y2VwdGlvbi5o) | `0.00% <0.00%> (ø)` | |
   | [libs/utils/src/celix\_file\_utils.c](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy91dGlscy9zcmMvY2VsaXhfZmlsZV91dGlscy5j) | `80.41% <80.41%> (ø)` | |
   | [libs/promises/api/celix/impl/SharedPromiseState.h](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9wcm9taXNlcy9hcGkvY2VsaXgvaW1wbC9TaGFyZWRQcm9taXNlU3RhdGUuaA==) | `85.48% <97.43%> (+1.43%)` | :arrow_up: |
   | [...ration/src/TestExportImportRemoteServiceFactory.cc](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnVuZGxlcy9jeHhfcmVtb3RlX3NlcnZpY2VzL2ludGVncmF0aW9uL3NyYy9UZXN0RXhwb3J0SW1wb3J0UmVtb3RlU2VydmljZUZhY3RvcnkuY2M=) | `83.54% <100.00%> (+1.65%)` | :arrow_up: |
   | [libs/promises/api/celix/DefaultScheduledExecutor.h](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9wcm9taXNlcy9hcGkvY2VsaXgvRGVmYXVsdFNjaGVkdWxlZEV4ZWN1dG9yLmg=) | `96.55% <100.00%> (+0.32%)` | :arrow_up: |
   | [libs/promises/api/celix/Deferred.h](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9wcm9taXNlcy9hcGkvY2VsaXgvRGVmZXJyZWQuaA==) | `100.00% <100.00%> (ø)` | |
   | [libs/promises/api/celix/Promise.h](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9wcm9taXNlcy9hcGkvY2VsaXgvUHJvbWlzZS5o) | `96.15% <100.00%> (+0.32%)` | :arrow_up: |
   | [libs/promises/api/celix/PromiseFactory.h](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9wcm9taXNlcy9hcGkvY2VsaXgvUHJvbWlzZUZhY3RvcnkuaA==) | `100.00% <100.00%> (ø)` | |
   | [.../pubsub\_admin\_zmq/v2/src/pubsub\_zmq\_topic\_sender.c](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnVuZGxlcy9wdWJzdWIvcHVic3ViX2FkbWluX3ptcS92Mi9zcmMvcHVic3ViX3ptcV90b3BpY19zZW5kZXIuYw==) | `86.91% <0.00%> (-1.27%)` | :arrow_down: |
   | ... and [7 more](https://codecov.io/gh/apache/celix/pull/360/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/celix/pull/360?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/celix/pull/360?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [2430b07...87456ec](https://codecov.io/gh/apache/celix/pull/360?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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@celix.apache.org

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



[GitHub] [celix] pnoltes commented on a change in pull request #360: Feature/promise timeout memleak

Posted by GitBox <gi...@apache.org>.
pnoltes commented on a change in pull request #360:
URL: https://github.com/apache/celix/pull/360#discussion_r704135276



##########
File path: libs/promises/api/celix/DefaultScheduledExecutor.h
##########
@@ -108,9 +111,12 @@ namespace celix {
         void wait() override {
             bool done = false;
             while (!done) {
-                std::lock_guard<std::mutex> lck{mutex};
+                std::unique_lock lck{mutex};

Review comment:
       should be lock_guard instead of unique_lock (left over from some reverted refactoring)




-- 
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@celix.apache.org

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



[GitHub] [celix] pnoltes commented on a change in pull request #360: Feature/promise timeout memleak

Posted by GitBox <gi...@apache.org>.
pnoltes commented on a change in pull request #360:
URL: https://github.com/apache/celix/pull/360#discussion_r704137162



##########
File path: libs/promises/api/celix/PromiseFactory.h
##########
@@ -43,31 +42,30 @@ namespace celix {
         PromiseFactory& operator=(const PromiseFactory&) = default;
 
         template<typename T>
-        [[nodiscard]] celix::Deferred<T> deferred(int priority = 0) const;
+        [[nodiscard]] celix::Deferred<T> deferred(int priority = 0);

Review comment:
       reintroduce const




-- 
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@celix.apache.org

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