Closed regenttsui closed 4 months ago
You used a very old version of redis-plus-plus. Please update to the latest one, and try again. This problem should have been fixed.
You used a very old version of redis-plus-plus. Please update to the latest one, and try again. This problem should have been fixed.
I tried the version 1.3.12, but the problem still exists
I manually shutdown the Redis before the deconstruction of std::lock_guard
Sorry, I missed this. Yes, this is a problem. Looks like that unlock
should not throw. However, in this case, application which calls unlock
directly, cannot tell if unlock
successes or not.
Thanks for reporting it! I'll rethink it, and fix it.
Regards
I checked std::mutex::unlock
implementation, in fact, it also might throw in some edge cases, cases that seldom happen. However, RedMutex need to do network operations to do unlock, and it might fail once the connection is broken. So I removed the code that throws exception to ensure the program does not terminate in that case.
Problem has been fixed, please try the latest code on master branch.
Thanks again for reporting this bug! And sorry for the late fix.
Regards
Describe the problem If an exception occurs during the automatic unlocking in the destructor of
std::lock_guard
,it seems to cause the program to terminate. Here is an example, I manually shutdown the Redis before the deconstruction ofstd::lock_guard
:I think the reason is that the exception is re-thrown in the destructor. Here is the source code of redispp:
Environment: