-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
monitor_operation::PostAndWait prevents shutdown #31
Comments
Do you want to make a PR for this? |
... and test case, please ;) |
This method ensures the correctness of dir_monitor service completion in case of destruction of external io_service (which passed to |
I'm away from my computer for the remainder of easter (until monday), so I won't be able to test this properly until then. The problem I see with using a condition variable (a synchronization device) is that it prevents the interal (implementation) thread from ever finishing. Your testcase will be valid, but if you were to test this in a (multi)threaded application where your external/local io_service is stopped, you would find that your application never closes. I'll ponder on how to write a proper test case for this, until I can get back to my computer. |
Question after reading the comment in the testcase: why would you ever want async_monitor to block?
|
async processing most probably needs more fixes. |
As per the boost documentation: "A service's shutdown_service member function must cause all copies of user-defined handler objects that are held by the service to be destroyed.". When A simple fix to this problem is to not post to the external handler if the error code is an I'll see if I can create a PR and a second test case for my initial problem (against the new develop branch). |
This is supposed to be fixed by PR #40 right? |
@berkus this issue is about Windows implementation while PR #40 affects *nix. |
@berkus Yes, PR #40 was the fix for this issue. @sbelsky My issue was actually with the inotify implementation, but I now see that the windows implementation was similar, so I guess the problem exists there as well. I haven't tried to compile the project on Windows (I need to install MSVC first), but It seems likely that the contents of PR #40 needs to mirrored to |
fast check give me unsatisfactory result (((( |
@sbelsky I'll install MSVC (probably VS2015) and test this further this week. |
@akapelrud i bet you'll not see any issue with your local assembly. |
The current implementation of
monitor_operation::PostAndWait
prevents the call toasync_monitor_thread_.join();
inshutdown_service()
from finishing.PostAndWait
waits on astd::condition_variable
that is never notified as the lambda handler is newer run after shutdown. This prevents the thread from ever finishing.Either remove the waiting part, or possibly do something like
The text was updated successfully, but these errors were encountered: