Connection # logging doesn't always properly report in Sqlite.jsm

RESOLVED FIXED in mozilla21

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: gps, Assigned: gps)

Tracking

unspecified
mozilla21
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Assignee

Description

7 years ago
Derp.

0:00.37 Sqlite.Connection.close_during_transaction.sqlite	TRACE	Conn #1: Stmt #5 ROLLBACK TRANSACTION
 0:00.37 
 0:00.37 TEST-PASS | /Users/gps/src/services-central/obj-firefox/_tests/xpcshell/toolkit/modules/tests/xpcshell/test_sqlite.js | [test_close_during_transaction : 273] Connection being closed. == Connection being closed.
 0:00.37 
 0:00.37 TEST-PASS | /Users/gps/src/services-central/obj-firefox/_tests/xpcshell/toolkit/modules/tests/xpcshell/test_sqlite.js | [test_close_during_transaction : 275] true == true
 0:00.37 Sqlite.ConnectionOpener	INFO	Opening database: /var/folders/hl/c8xf3l7j4tz0t4fyvsgn8_dc0000gn/T/firefox/xpcshellprofile/close_during_transaction.sqlite (close_during_transaction.sqlite#2)
 0:00.37 Sqlite.Connection.close_during_transaction.sqlite	INFO	Conn #2: Opened
 0:00.37 Sqlite.Connection.close_during_transaction.sqlite	TRACE	Conn #2: Stmt #0 SELECT * FROM dirs
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	DEBUG	Conn #2: Stmt #5 finished
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	DEBUG	Conn #2: Finalizing connection.
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	DEBUG	Conn #2: Calling asyncClose().
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	DEBUG	Conn #2: Stmt #0 finished
 0:00.38 
 0:00.38 TEST-PASS | /Users/gps/src/services-central/obj-firefox/_tests/xpcshell/toolkit/modules/tests/xpcshell/test_sqlite.js | [test_close_during_transaction : 280] 1 == 1
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	DEBUG	Conn #2: Request to close connection.
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	DEBUG	Conn #2: Finalizing connection.
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	DEBUG	Conn #2: Calling asyncClose().
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	INFO	Conn #2: Closed
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	WARN	Conn #2: Connection was closed while performing transaction. Unable to commit.
 0:00.38 Sqlite.Connection.close_during_transaction.sqlite	INFO	Conn #2: Closed

This should be a trivial fix.
Assignee

Comment 1

7 years ago
Ugh. This is a "fun" problem. The problem is the logger is shared among all users. So, our pattern of redefining the logging function on one instance won't really work since those changes will apply to all other users.

So, we'll likely have to resort to some prototype inheritance or proxy object. Ugh.
Assignee

Comment 2

7 years ago
I /think/ this is proper. I can't remember if there is some gotcha with doing prototype inheritance like this...

I have a feeling I may eventually use this bug as an interview question :)
Assignee: nobody → gps
Status: NEW → ASSIGNED
Attachment #703505 - Flags: review?(rnewman)
Comment on attachment 703505 [details] [diff] [review]
Correctly install logging functions, v1

Review of attachment 703505 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/modules/Sqlite.jsm
@@ +165,1 @@
>        return Log4Moz.Logger.prototype[lc].call(log, "Conn #" + number + ": " + msg);

Shouldn't this be something like

  return log[lc].call(…);

?
Attachment #703505 - Flags: review?(rnewman) → review+
Assignee

Comment 5

7 years ago
https://hg.mozilla.org/mozilla-central/rev/b4a8a77afe40
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in services]
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.