Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit 6edbee7

Browse files
thinker0Code0x58
andauthored
Allow localhost graceful shutdown (#3650)
* Allow localhost graceful shutdown * Update heron/shell/src/python/handlers/killexecutorhandler.py Co-authored-by: Oliver Bristow <[email protected]> Co-authored-by: Oliver Bristow <[email protected]>
1 parent b363319 commit 6edbee7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

heron/shell/src/python/handlers/killexecutorhandler.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,16 @@ def kill_parent():
4444
logger.info("Killing parent executor")
4545
os.killpg(os.getppid(), signal.SIGTERM)
4646

47+
def is_local():
48+
return self.request.remote_ip in ('localhost', '127.0.0.1', '::1')
49+
4750
logger = logging.getLogger(__file__)
4851
logger.info("Received 'Killing process' request")
4952
data = dict(parse_qsl(self.request.body))
5053

5154
# check shared secret
5255
sharedSecret = data.get('secret')
53-
if sharedSecret != options.secret:
56+
if not is_local() and sharedSecret != options.secret:
5457
status_finish(403)
5558
return
5659

0 commit comments

Comments
 (0)