Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Review Summary by QodoFix signal handler to only handle graceful termination signals
WalkthroughsDescription• Restrict signal handler to graceful termination signals only • Remove unsafe crash signal handling (SIGSEGV, SIGABRT, SIGFPE) • Replace exit() with std::exit() for proper cleanup • Add clarifying comments about signal handling limitations Diagramflowchart LR
A["Signal Handler Setup"] --> B["Remove Crash Signals"]
B --> C["Keep SIGINT/SIGTERM/SIGQUIT"]
C --> D["Use std::exit()"]
D --> E["Improved Safety"]
File Changes1. tools/python_bind/src/neug_binding.cc
|
Code Review by Qodo
|
| } | ||
| } // namespace neug | ||
|
|
||
| bool get_is_interactive() { |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Refactors the database directory locking mechanism to use OS-level file locks and removes prior signal-based cleanup, while updating error handling and related tests.
Changes:
- Reworked
FileLockto usefcntllocks and added in-process lock tracking. - Updated lock-related exception messages and adjusted Python tests accordingly.
- Hardened temp directory cleanup in
NeugDBdestructor with exception handling.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/python_bind/tests/test_db_transaction.py | Updates assertions to match new lock error message wording. |
| tools/python_bind/src/neug_binding.cc | Removes signal handler cleanup logic tied to previous lock-file behavior. |
| src/main/neug_db.cc | Wraps temp-dir cleanup in try/catch; changes lock acquisition to return a specific locked exception message. |
| src/main/file_lock.cc | Implements fcntl-based locking and in-process tracking; changes lock/unlock semantics and messaging. |
| include/neug/main/file_lock.h | Updates FileLock API/fields; removes global lock cleanup API. |
| bin/rt_server.cc | Removes signal handler cleanup logic tied to previous lock-file behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| allLockFiles.erase(lock_file_path_); | ||
| std::string error_msg; | ||
| if (!lock(F_UNLCK, true, error_msg)) { | ||
| LOG(WARNING) << "Failed to unlock file lock: " << error_msg; |
Fixes