osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] activemq-cpp pull request #5: Move timer objects to the end of member list


GitHub user unjello opened a pull request:

    https://github.com/apache/activemq-cpp/pull/5

    Move timer objects to the end of member list

    In high CPU load it can happen, that Timer thread wakes up,
    is swapped out, and when application resumes it does not resume with timer
    thread, but transport thread, that decides to do failover, destroys
    `InactivityMonitor` object. When its members are getting destroyed,
    they arrive at `Timer` object that joins, timer thread resumes in
    `writeCheck` or `readCheck` method, only to find out `asyncTasks` is already
    destroyed because it comes later in member declaration list so it was
    destroyed first. Moving `Timer` object to the end of the list, guarantees
    that they will be destroyed first, so their threads will get joined and
    allowed to finish, before the rest of the object is destroyed.
    
    Closes AMQCPP-626

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/unjello/activemq-cpp fix/amqcpp-626

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-cpp/pull/5.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5
    
----
commit fced83a9da3531e0b6875c80714d47424449f29c
Author: Andrzej Lichnerowicz <andrzej@...>
Date:   2018-03-12T15:20:31Z

    Move timer objects to the end of member list
    
    In high CPU load it can happen, that Timer thread wakes up,
    is swapped out, and when application resumes it does not resume with timer
    thread, but transport thread, that decides to do failover, destroys
    `InactivityMonitor` object. When its members are getting destroyed,
    they arrive at `Timer` object that joins, timer thread resumes in
    `writeCheck` or `readCheck` method, only to find out `asyncTasks` is already
    destroyed because it comes later in member declaration list so it was
    destroyed first. Moving `Timer` object to the end of the list, guarantees
    that they will be destroyed first, so their threads will get joined and
    allowed to finish, before the rest of the object is destroyed.
    
    Closes AMQCPP-626

----


---