Closed
Bug 256592
Opened 21 years ago
Closed 21 years ago
DBD errors (especially "packet too large") kill browser
Categories
(Bugzilla :: Bugzilla-General, defect)
Bugzilla
Bugzilla-General
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: glob, Assigned: glob)
Details
(Keywords: regression)
Attachments
(1 file, 2 obsolete files)
|
623 bytes,
patch
|
goobix
:
review+
|
Details | Diff | Splinter Review |
if you try to add an attachment that is greater than mysql's
'max_allowed_packet' variable, the resulting error message contains the
attachment as text, as it contains the sql that failed. this kills firefox on
my pc.
we should truncate DBI error messages to avoid this.
sets maximum length of dbd errors to 4096 chars. no real reason for that
particular value :)
Attachment #156806 -
Flags: review?
Comment 2•21 years ago
|
||
Will this still put the full error message somewhere? It is important that it
be accessible. If we truncate the message to the browser, let's make sure it
goes in the webserver error log.
Comment 3•21 years ago
|
||
If we set the limit to 10000 bytes, is it really important to have it in
webserver log? I mean, are there any practical conditions where SQL after 10000
chars would be relevant even for the admin (the only case for that is probably
the attachment thing anyway - flooding the attachments into the webserver log
doesn't sound necessary to me anyway).
jouni, that was exactly my thinking, i just picked a lower value :)
Comment 5•21 years ago
|
||
Comment on attachment 156806 [details] [diff] [review]
dbd errors v1
Works. Good to have -- I agree with Byron and Jouni.
Attachment #156806 -
Flags: review? → review+
Comment 7•21 years ago
|
||
For the record, this is a regression. This bug was previously reported as bug
57819, and was fixed by Gerv with a patch checked in on 2001-10-13. The code
was subsequently lost when the DB stuff got ported to its own module by bbaetz
on 2003-01-14. Clearing the approval flags because I plan to deny review on
this patch for the same reason I made Gerv back out his initial fix to bug 57819.
Comment 8•21 years ago
|
||
Comment on attachment 156806 [details] [diff] [review]
dbd errors v1
We need to keep the end of the error message, because that's where the actual
error is given. Ideally we need to truncate from the middle and keep both ends
of the error. The original fix for this that got lost kept 2K off each end and
added an elipsis (...) in the middle.
Attachment #156806 -
Flags: review-
Attachment #156806 -
Attachment is obsolete: true
Attachment #167916 -
Flags: review?
Comment 10•21 years ago
|
||
Comment on attachment 167916 [details] [diff] [review]
dbd errors v2
+ $errstr = substr($errstr, 0, 2000) . ' ... ' . substr($errstr, -2000)
+ if length($errstr) > 4000;
Well I guess we could use substr($_[0], 0, 2000) and such for performance
reasons, but this works as well I guess.
Attachment #167916 -
Flags: review? → review+
| Assignee | ||
Comment 11•21 years ago
|
||
it's a fatal database error, i don't think performance is critical :)
Comment 12•21 years ago
|
||
(In reply to comment #7)
> for the same reason I made Gerv back out his initial fix to bug 57819.
Dave, I don't know about you, but I don't see anywhere in bug 57819 anything to
indicate that Gerv backed out its original patch. As far as I can see, an
improvement uploaded as the second patch was applied over it. The original patch
was never backed out.
Comment 13•21 years ago
|
||
(In reply to comment #11)
> it's a fatal database error, i don't think performance is critical :)
$_[0] could contain the whole attachment, which could be a .jpg or something
else, 1 MB wide or something like that. That could take a while to copy from one
place to another... :)
| Assignee | ||
Comment 14•21 years ago
|
||
Attachment #167916 -
Attachment is obsolete: true
Comment 15•21 years ago
|
||
Comment on attachment 167920 [details] [diff] [review]
dbd errors v3
This one rocks, no $errstr at all! :)
Attachment #167920 -
Flags: review+
Updated•21 years ago
|
Flags: approval?
Flags: approval2.18?
Comment 16•21 years ago
|
||
(In reply to comment #12)
> Dave, I don't know about you, but I don't see anywhere in bug 57819 anything to
> indicate that Gerv backed out its original patch. As far as I can see, an
> improvement uploaded as the second patch was applied over it. The original patch
> was never backed out.
Technicalities! It was the thought that counts, or something like that ;)
Flags: approval?
Flags: approval2.18?
Flags: approval2.18+
Flags: approval+
Comment 17•21 years ago
|
||
Checking in Bugzilla/DB.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB.pm,v <-- DB.pm
new revision: 1.12.2.2; previous revision: 1.12.2.1
done
Checking in Bugzilla/DB.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB.pm,v <-- DB.pm
new revision: 1.14; previous revision: 1.13
done
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•