[Bugfix] Do not use resource module on Windows (#12858) (#13029)

This commit is contained in:
MoonRide303 2025-02-11 17:21:18 +01:00 committed by GitHub
parent bf3e05215c
commit 21f5d50fa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,6 @@ import ipaddress
import multiprocessing
import os
import re
import resource
import signal
import socket
import subprocess
@ -2070,6 +2069,11 @@ def memory_profiling(
# Adapted from: https://github.com/sgl-project/sglang/blob/v0.4.1/python/sglang/srt/utils.py#L630 # noqa: E501
def set_ulimit(target_soft_limit=65535):
if sys.platform.startswith('win'):
logger.info("Windows detected, skipping ulimit adjustment.")
return
import resource
resource_type = resource.RLIMIT_NOFILE
current_soft, current_hard = resource.getrlimit(resource_type)