-
Notifications
You must be signed in to change notification settings - Fork 31
Fixing log message spam #386
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,6 +30,7 @@ static std::atomic_bool em_cancelled{false}; | |||||
| static void my_signal_handler(int) | ||||||
| { | ||||||
| em_cancelled.store(true); | ||||||
| ControlClientChannel::nudgeControlClientHandler(); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: nudgeControlClientHandler uses SCORE_LANGUAGE_FUTURECPP_ASSERT_MESSAGE and we do not have a signal-safe assertion handler right now.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be called before the control client is setup? E.g. launch manager is started but directly receives a SIGTERM/SIGINT
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once #303 is merged we can use the new signal-safe logging functions from there. |
||||||
| } | ||||||
|
|
||||||
| void ProcessGroupManager::cancel() | ||||||
|
|
@@ -142,16 +143,13 @@ inline bool ProcessGroupManager::initializeControlClientHandler() | |||||
| // The name is removed from the file system after creation, memory | ||||||
| // is mapped and a pointer stored, the FD is kept open. | ||||||
| ControlClientChannel::nudgeControlClientHandler_ = nullptr; | ||||||
| char shm_name[static_cast<uint32_t>(score::lcm::internal::ProcessLimits::maxLocalBuffSize)]; | ||||||
| constexpr static std::string_view shm_name{"/_nudge~._.~me_"}; | ||||||
|
|
||||||
| static_cast<void>(snprintf(shm_name, | ||||||
| static_cast<uint32_t>(score::lcm::internal::ProcessLimits::maxLocalBuffSize), | ||||||
| "/_nudge~._.~me_")); // random name | ||||||
| int fd = shm_open(shm_name, O_CREAT | O_EXCL | O_RDWR, 0U); | ||||||
| int fd = shm_open(shm_name.data(), O_CREAT | O_EXCL | O_RDWR, 0U); | ||||||
|
|
||||||
| if (fd >= 0) | ||||||
| { | ||||||
| shm_unlink(shm_name); | ||||||
| shm_unlink(shm_name.data()); | ||||||
|
|
||||||
| if (0 == ftruncate(fd, static_cast<off_t>(sizeof(osal::Semaphore)))) | ||||||
| { | ||||||
|
|
@@ -464,10 +462,6 @@ bool ProcessGroupManager::sendResponse(ControlClientMessage msg) | |||||
| << static_cast<int>(msg.request_or_response_) << ") re state" | ||||||
| << msg.process_group_state_.pg_state_name_ << "of PG" << msg.process_group_state_.pg_name_; | ||||||
| ret = scc->sendResponse(msg); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice to clean up this variable which is not necessary since the
Suggested change
|
||||||
| if (!ret) | ||||||
| { | ||||||
| ControlClientChannel::nudgeControlClientHandler(); | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check for errors here?