Completion of error handling
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 69
Description
Would you like to add more error handling for return values from functions like the following?
* [atexit](https://pubs.opengroup.org/onlinepubs/9699919799/functions/atexit.html "Register a function to run at process termination") ⇒ [make_thread_atexit_key](https://github.com/apache/brpc/blob/ced4c70404a7ea46451a895e06240636914c92ac/src/butil/thread_local.cpp#L89)
* [malloc](https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html "Memory allocation") ⇒ [Arena::allocate_new_block](https://github.com/apache/brpc/blob/60159fc3f3e13490fb9806ea0a0cb0dcdbda7f7d/src/butil/arena.cpp#L66)
* [pthread_mutex_init](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html "Initialize a mutex") ⇒ [InfoThread constructor](https://github.com/apache/brpc/blob/60159fc3f3e13490fb9806ea0a0cb0dcdbda7f7d/tools/rpc_replay/info_thread.cpp#L22)
Contributor guide
Research direction
Start by reviewing the linked call sites in src/butil/thread_local.cpp, src/butil/arena.cpp, and tools/rpc_replay/info_thread.cpp, along with the referenced POSIX function documentation. Determine how failures from atexit, malloc, and pthread_mutex_init should be handled in each context. Done means the requested return-value error handling is consistently addressed and the relevant behavior is verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100