Skip to content

Conversation

@PengZheng
Copy link
Contributor

@PengZheng PengZheng commented Mar 17, 2022

static void *fw_eventDispatcher(void *fw) {
    framework_pt framework = (framework_pt) fw;

    celixThreadMutex_lock(&framework->dispatcher.mutex);
    bool active = framework->dispatcher.active;
    celixThreadMutex_unlock(&framework->dispatcher.mutex);

    while (active) { //first check active then handle events
        fw_handleEvents(framework);
        celixThreadMutex_lock(&framework->dispatcher.mutex);
        active = framework->dispatcher.active;
        celixThreadMutex_unlock(&framework->dispatcher.mutex);
    }
    //omitted
}

If shell_cmd happens to shutdown the framework during this first-check-then-do race window, unnecessary 1 second delay follows.

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2022

Codecov Report

Merging #402 (aa98685) into master (3b651da) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #402      +/-   ##
==========================================
- Coverage   73.12%   73.12%   -0.01%     
==========================================
  Files         205      205              
  Lines       31272    31272              
==========================================
- Hits        22869    22867       -2     
- Misses       8403     8405       +2     
Impacted Files Coverage Δ
libs/framework/src/framework.c 79.54% <100.00%> (ø)
libs/utils/src/hash_map.c 93.53% <0.00%> (-0.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b651da...aa98685. Read the comment docs.

@PengZheng
Copy link
Contributor Author

About the shell test deadlock: https://github.com/apache/celix/runs/5562712613?check_suite_focus=true#step:5:3036
I have not been able to reproduce it in my local environment.

@pnoltes
Copy link
Contributor

pnoltes commented Mar 17, 2022

About the shell test deadlock: https://github.com/apache/celix/runs/5562712613?check_suite_focus=true#step:5:3036
I have not been able to reproduce it in my local environment.

I also have not been able to reproduce this locally.

@PengZheng PengZheng merged commit c83bc07 into master Mar 18, 2022
@PengZheng PengZheng deleted the hotfix/framework_shutdown_deadlock branch March 18, 2022 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants