summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2024-04-30 20:20:43 +0000
committerElliott Hughes <enh@google.com>2024-04-30 20:20:43 +0000
commitc9d44b84fef800f5edb6225b1dd20420b38d4037 (patch)
tree00931338144915f59320832beb4f1d825619cc27 /init
parent8240c53ec2b3eacc96bff755893cf40e60cdb80b (diff)
downloadcore-c9d44b84fef800f5edb6225b1dd20420b38d4037.tar.gz
Don't reject "ctl.stop.*" during shutdown.
We're shutting down anyway, so the service is either dead already or about to be killed, and callers get upset (and don't have a good response themselves) if we reject the request. This was seen by a partner where adbd was asked to stop during shutdown. Bug: https://issuetracker.google.com/336223505 Change-Id: If09feeef2e0f2d1be9ff84a88cca6ed593a35362
Diffstat (limited to 'init')
-rw-r--r--init/property_service.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/init/property_service.cpp b/init/property_service.cpp
index 5a1b63b2e..d02ca1e49 100644
--- a/init/property_service.cpp
+++ b/init/property_service.cpp
@@ -453,6 +453,10 @@ static uint32_t SendControlMessage(const std::string& msg, const std::string& na
SocketConnection* socket, std::string* error) {
auto lock = std::lock_guard{accept_messages_lock};
if (!accept_messages) {
+ // If we're already shutting down and you're asking us to stop something,
+ // just say we did (https://issuetracker.google.com/336223505).
+ if (msg == "stop") return PROP_SUCCESS;
+
*error = "Received control message after shutdown, ignoring";
return PROP_ERROR_HANDLE_CONTROL_MESSAGE;
}