Skip to content
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

temporary hack to avoid HTTP code strings in messages #7147

Merged
merged 1 commit into from
Mar 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/python/ServerUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,14 @@ def truncateError(msg):
"""Truncate the error message to the first 7400 chars if needed, and add a message if we truncate it.
See https://github.com/dmwm/CRABServer/pull/4867#commitcomment-12086393
"""
MSG_LIMIT = 7500
MSG_LIMIT = 1100
# hack to avoid passing HTTP error code to message parsing code in CRABClient/CrabRestInterface.py
codeString = 'HTTP/1.'
if codeString in msg :
msg = msg.replace(codeString,'HTTP 1.')
if len(msg) > MSG_LIMIT:
truncMsg = msg[:MSG_LIMIT - 100]
truncMsg += "\n[... message truncated to the first 7400 chars ...]"
truncMsg += "\n[... message truncated to the first %d chars ...]" % (MSG_LIMIT-100)
return truncMsg
else:
return msg
Expand Down