Closed monolidth closed 2 years ago
@monolidth , thanks for the feedback, could you please make a demo code to reproduce this problem? I need to debug it in my local environment.
Thank you for the immediate feedback. I will prepare a demo code as soon as possible.
Cannot reproduce, it is so a random bug but will try.
It's like a race condition somewhere, note that when the database coroutine resume, it's in the thread of the I/O thread of the DbClient, so please pay attention to the shared state which may be accessed in multiple threads.
Send the demo code via email. Thank you!
Segmentation fault in RedisTransaction
Hi @an-tao, thanks for the awesome open-source project and the effort you put in this project. I really appreciate your project!
Summary I added a cache functionality in our project and use coroutines to fetch a cache result. However, if I run my current implementation for a while I face a segmentation fault triggered from a fail assertion.
Trace
To Reproduce
1. Define handler
Where handleRequest first try to fetch the result from the redis cache and if it not present it perform a network call and write the result back to the cache.
2. Implement cache
3. Use the cache
Expected behavior The segmentation fault should not occur.
System specifications
OS: Archlinux GCC Version: 11.1.0 C-ares: c-ares-1.18.1
Drogon specifications
Additional context I run the drogon framework in a docker container. Nevertheless the segmentation fault occur on my debug machine as well.
Just let me know if you need additionally information or a test stub.
Regards, William Todt