-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Serve] fix logging error on passing traceback object into exc_info #46105
Conversation
Signed-off-by: Gene Su <e870252314@gmail.com>
class MyDeployment: | ||
def __call__(self) -> str: | ||
return "Hello world!" | ||
# Set log directory for the deployment. | ||
@serve.deployment(LoggingConfig(logs_dir="/my_dir") | ||
@serve.deployment(LoggingConfig(logs_dir="/my_dir")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a doc change, since I saw it while reading it. Unrelated to the actual bug.
@@ -100,7 +100,7 @@ def format(self, record: logging.LogRecord) -> str: | |||
The formatted log record in json format. | |||
""" | |||
record_format = copy.deepcopy(self.component_log_fmt) | |||
record_attributes = copy.deepcopy(record.__dict__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no idea why this was here in the first place...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel it's probably a copy pasta from the line above 😅
Signed-off-by: Gene Su <e870252314@gmail.com>
Why are these changes needed?
The root cause for the logging error we saw was due to the client passing traceback object into
exc_info
during logging. In serve logger we do a deepcopy on the log record's__dict__
attribute which was unable to pickle the traceback for the deep copy. This PR removed the deepcopy completely since we do not modify to the copied dict at all. Also added a test to ensure the regression doesn't happen.Related issue number
Closes #45912
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.