Skip to content

Commit

Permalink
Prevent stacktrace during SIGTERM signal and open_device call
Browse files Browse the repository at this point in the history
Signed-off-by: Ronan Abhamon <[email protected]>
  • Loading branch information
Wescoeur committed Nov 18, 2024
1 parent 1c0bef3 commit 65e40e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions http_disk_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ def emit_server_ready():
disk_fd = open_device(disk, retry=False)
else:
disk_fd = open_device(disk)

if SIGTERM_RECEIVED:
break

is_block_device = stat.S_ISBLK(os.fstat(disk_fd).st_mode)

HandlerClass = MakeRequestHandler(disk_fd, is_block_device)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

setup(
name="http-nbd-transfer",
version="1.4.0",
version="1.5.0",
description="Set of tools to transfer NBD requests to an HTTP server",
author="Ronan Abhamon <[email protected]>",
author_email="[email protected]",
Expand Down

0 comments on commit 65e40e8

Please sign in to comment.