Skip to content

Commit

Permalink
Check sys platform before using SIGQUIT - fix windows development (ku…
Browse files Browse the repository at this point in the history
…beflow#3089)

Signed-off-by: Andrews Arokiam <andrews.arokiam@ideas2it.com>
  • Loading branch information
andyi2it authored Aug 20, 2023
1 parent faabcdb commit 2f5b778
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/kserve/kserve/model_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
import argparse
import asyncio
import concurrent.futures
Expand Down Expand Up @@ -153,7 +154,12 @@ def start(self, models: Union[List[Model], Dict[str, Deployment]]) -> None:
async def serve():
logger.info(f"Starting uvicorn with {self.workers} workers")
loop = asyncio.get_event_loop()
for sig in [signal.SIGINT, signal.SIGTERM, signal.SIGQUIT]:
if sys.platform not in ['win32', 'win64']:
sig_list = [signal.SIGINT, signal.SIGTERM, signal.SIGQUIT]
else:
sig_list = [signal.SIGINT, signal.SIGTERM]

for sig in sig_list:
loop.add_signal_handler(
sig, lambda s=sig: asyncio.create_task(self.stop(sig=s))
)
Expand Down

0 comments on commit 2f5b778

Please sign in to comment.