-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(udf): add graceful shutdown for python UDF server (#13285)
Signed-off-by: Runji Wang <[email protected]>
- Loading branch information
1 parent
8fae5b5
commit 61c3e2c
Showing
7 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
system ok | ||
python3 e2e_test/udf/test.py & | ||
|
||
# wait for server to start | ||
sleep 1s | ||
|
||
statement ok | ||
CREATE FUNCTION sleep(INT) RETURNS INT AS 'sleep' USING LINK 'http://localhost:8815'; | ||
|
||
system ok | ||
sleep 1 && pkill python & | ||
|
||
# python server should not exit until the query is finished | ||
query I | ||
select sleep(2); | ||
---- | ||
0 | ||
|
||
# wait for server to exit | ||
sleep 1s | ||
|
||
system ok | ||
python3 e2e_test/udf/test.py & | ||
|
||
# wait for server to start | ||
sleep 1s | ||
|
||
# force kill python server | ||
system ok | ||
sleep 1 && pkill -9 python & | ||
|
||
query error | ||
select sleep(2); | ||
|
||
statement ok | ||
DROP FUNCTION sleep; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
## [0.0.11] - 2023-11-06 | ||
|
||
### Fixed | ||
|
||
- Hook SIGTERM to stop the UDF server gracefully. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters