Bugzilla->dbh will become invalid in long jobqueue.pl runs

RESOLVED FIXED in Bugzilla 3.4

Status

()

defect
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: mkanat, Assigned: mkanat)

Tracking

3.5.2
Bugzilla 3.4
Bug Flags:
approval +
approval3.4 +

Details

Attachments

(1 attachment)

In a CGI script, DBI automatically reconnects to the database if it's disconnected. In a command-line script, it doesn't--you have to specify an attribute for the database to make this happen. So in long-running jobqueue.pl runs, if something were to access the database, it would fail. I think that our current jobs don't do this, but I ran into it with a customization, at least.

I really thought that I already filed and fixed this, but I guess not.
Posted patch v1Splinter Review
Technically I don't need review on this (since I'm the module owner) but I wanted to get a second opinion on the fact that Pg seems to not need/support a similar attribute.

Also, Xiaoou--does Oracle need anything like this to automatically reconnect during long-running processes?
Assignee: database → mkanat
Status: NEW → ASSIGNED
Attachment #420853 - Flags: review?(LpSolit)
Comment on attachment 420853 [details] [diff] [review]
v1

>+        mysql_auto_reconnect => 1,

From what I can read at http://dev.mysql.com/doc/refman/5.0/en/auto-reconnect.html, this has the side-effect to roll back transactions (and to release table locks, which we fortunately don't use anymore), and last_insert_id() is also reset. Is that what we want?
(In reply to comment #2)
> From what I can read at
> http://dev.mysql.com/doc/refman/5.0/en/auto-reconnect.html, this has the
> side-effect to roll back transactions (and to release table locks, which we
> fortunately don't use anymore), and last_insert_id() is also reset. Is that
> what we want?

  Yes. If you think about it, this is fine. The auto reconnect is only intended for idle timeouts, and is already on by default in CGI apps.
(In reply to comment #1)

> Also, Xiaoou--does Oracle need anything like this to automatically reconnect
> during long-running processes?

I am afraid not.
(In reply to comment #4)
> I am afraid not.

  Okay. So are you saying that it needs it and doesn't have it, or that it doesn't need it?
Yeah.
(In reply to comment #6)
> Yeah.

  Yeah to which one?
Attachment #420853 - Flags: review?(LpSolit) → review+
Flags: approval+
Checking in Bugzilla/DB/Mysql.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm,v  <--  Mysql.pm
new revision: 1.80; previous revision: 1.79
done
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
  This should have gone back on to the branch for 3.4, because this bug essentially means that jobqueue.pl stops working after a certain amount of time, if people have a connection timeout specified in MySQL.
Flags: approval3.4+
Target Milestone: Bugzilla 3.6 → Bugzilla 3.4
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.4/                         
modified Bugzilla/DB/Mysql.pm
Committed revision 6749.
Duplicate of this bug: 559790
You need to log in before you can comment on or make changes to this bug.