Closed Bug 192531 Opened 21 years ago Closed 21 years ago

Bugzilla not properly closing DB statement handles

Categories

(Bugzilla :: Bugzilla-General, defect)

2.17.3
PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: justdave, Assigned: bbaetz)

Details

Attachments

(1 file, 1 obsolete file)

[Sun Feb  9 23:38:24 2003] show_bug.cgi: DBI::db=HASH(0x6039d8)->disconnect
invalidates 58 active statement handles (either destroy statement handles or
call finish on them before disconnecting) at Bugzilla.pm line 98.

Checking for             DBI (v1.32)   ok: found v1.32
Checking for      DBD::mysql (v2.1010) ok: found v2.1025

cvs-tip as of an hour ago.

Based on other symptoms I've run into lately paired with this, I suspect the
Pop/Push SQL State stuff isn't working right, but I have no clue why, because it
looks fine to me.
I can only reproduce this in a couple files, and not to such a great magnitude
on landfill/bugzilla-tip, which is running identical code to Bugscape, outside
of templates, currently.

The only difference?  Bugscape has a newer version of DBD::mysql.

Landfill has:

Checking for             DBI (v1.32)   ok: found v1.32
Checking for      DBD::mysql (v2.1010) ok: found v2.1022
How do you know that push/pop isn't working right?
oh, the other difference I forgot (sheepish grin)

Landfill is perl 5.8.0, Bugscape is 5.6.1
Attached patch fix (obsolete) — Splinter Review
local for a tied hash leaks in 5.6, and presumaly that includes a refcount
leak, which is why we get lots of sth leaks under 5.6

The other part is because the statment could still be active in the DB code.
See comments+links from the patch for details

I only very rearly see the leaks, though, so I can't repro. justdave was seeing
them more often - does this fix everything for you (rather than the patch I had
you try on irc?)
Comment on attachment 113993 [details] [diff] [review]
fix

reminding myself to look at this.  I'll try it out in the morning when I'm
awake.
Attachment #113993 - Flags: review?(justdave)
Comment on attachment 113993 [details] [diff] [review]
fix

didn't help (much).

However, as discussed on IRC, using this patch, as well as changing the
declarations of $_current_sth and @SQLStateStack from "my" to "our" did resolve
it.
Attachment #113993 - Flags: review?(justdave) → review-
Attached patch take 2Splinter Review
Attachment #113993 - Attachment is obsolete: true
Comment on attachment 114417 [details] [diff] [review]
take 2

r= justdave

This is pretty much identical to what I've already been running on Bugscape for
the last week.

BTW, this patch was needed for Sybase, too.  The side effects were much worse
on Sybase because of the Sybase CTlib's inability to handle more than one
active statement on the same connection (so DBD::Sybase emulates it by opening
a new connection if the previous statement hasn't been finished - and guess how
many stale handles there wound up sitting around. :)
Attachment #114417 - Flags: review+
Flags: approval+
Fixed
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 2.18
I get these warnings/errors on (what I think is a clean) cvs-tip at the moment:

[Fri Aug 27 21:49:25 2004] post_bug.cgi: DBI::db=HASH(0x98301c)->disconnect invalidates 1 active 
statement handle (either destroy statement handles or call finish on them before disconnecting) at 
Bugzilla.pm line 164.

Does anyone else?
I have this problem as well:

[Fri Sep 24 00:56:52 2004] [error] [client 69.224.23.182] [Fri Sep 24 00:56:52
2004] show_bug.cgi: DBI::db=HASH(0x87b174c)->disconnect invalidates 1 active
statement handle (either destroy statement handles or call finish on them before
disconnecting) at Bugzilla.pm line 164., referer:
https://prdatabase/report/buglist.cgi?query_format=specific&bug_status=__all__&product=AP&content=&order=bugs.bug_status

Is this affect perform of bugzilla? Is there a patch to fix this. I see there
are 2 atatchments on this page, but don't know what to do with it, sorry, I'm
not a perl programming so have no idea what it mean. I'm using bugzilla ver 1.8r2

Thank you,
Nguyen. 
(In reply to comment #11)
> I have this problem as well:

> Is this affect perform of bugzilla? Is there a patch to fix this. I see there
> are 2 atatchments on this page, but don't know what to do with it, sorry, I'm
> not a perl programming so have no idea what it mean. I'm using bugzilla ver
> 1.8r2

This was fixed a long time ago.  If you're seeing this in 2.18rc2 (I'm assuming
that's what you meant), it's a new bug.  Please file a new one.
The new bug is bug#261821
Assignee: justdave → bbaetz
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: