Closed Bug 1152333 Opened 5 years ago Closed 5 years ago

Warning: SQL statement "..." should have been finalized before closing the connection at the end of running unit tests

Categories

(Toolkit :: Storage, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: ehsan, Assigned: mak)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

Example STR: ./mach mochitest dom/cache

You get this as Firefox is shutting down:

[50650] WARNING: SQL statement 'SELECT b.guid, IFNULL(p.guid, "") AS parentGuid, b.position AS 'index',
            b.dateAdded, b.lastModified, b.type, b.title, h.url AS url,
            b.id AS _id, b.parent AS _parentId,
            (SELECT count(*) FROM moz_bookmarks WHERE parent = b.id) AS _childCount,
            p.parent AS _grandParentId
     FROM moz_bookmarks b
     LEFT JOIN moz_bookmarks p ON p.id = b.parent
     LEFT JOIN moz_places h ON h.id = b.fk
     WHERE p.guid = :parentGuid
     AND b.position = IFNULL(:index, (SELECT count(*) - 1
                                      FROM moz_bookmarks
                                      WHERE parent = p.id))
    ' (19d99d80) should have been finalized before closing the connection: file /Users/ehsan/moz/src.landing/storage/src/mozStorageConnection.cpp, line 926
[50650] WARNING: SQL statement 'WITH RECURSIVE
     ancestors(aid) AS (
       SELECT id FROM moz_bookmarks WHERE guid = :guid
       UNION ALL
       SELECT parent FROM moz_bookmarks
       JOIN ancestors ON id = aid
       WHERE type = :type
     )
     UPDATE moz_bookmarks SET lastModified = :time
     WHERE id IN ancestors
    ' (26339f60) should have been finalized before closing the connection: file /Users/ehsan/moz/src.landing/storage/src/mozStorageConnection.cpp, line 926
[50650] WARNING: SQL statement 'INSERT INTO moz_bookmarks (fk, type, parent, position, title,
                                  dateAdded, lastModified, guid)
       VALUES ((SELECT id FROM moz_places WHERE url = :url), :type, :parent,
               :index, :title, :date_added, :last_modified, :guid)
      ' (26339e30) should have been finalized before closing the connection: file /Users/ehsan/moz/src.landing/storage/src/mozStorageConnection.cpp, line 926
[50650] WARNING: SQL statement 'UPDATE moz_bookmarks SET position = position + 1
       WHERE parent = :parent
       AND position >= :index
      ' (26339d00) should have been finalized before closing the connection: file /Users/ehsan/moz/src.landing/storage/src/mozStorageConnection.cpp, line 926
[50650] WARNING: SQL statement 'INSERT OR IGNORE INTO moz_places (url, rev_host, hidden, frecency, guid)
         VALUES (:url, :rev_host, 0, :frecency, GENERATE_GUID())
        ' (26339aa0) should have been finalized before closing the connection: file /Users/ehsan/moz/src.landing/storage/src/mozStorageConnection.cpp, line 926
[50650] WARNING: SQL statement 'SELECT GENERATE_GUID() AS guid' (26339970) should have been finalized before closing the connection: file /Users/ehsan/moz/src.landing/storage/src/mozStorageConnection.cpp, line 926
[50650] WARNING: SQL statement 'SELECT b.guid, IFNULL(p.guid, "") AS parentGuid, b.position AS 'index',
            b.dateAdded, b.lastModified, b.type, b.title, h.url AS url,
            b.id AS _id, b.parent AS _parentId,
            (SELECT count(*) FROM moz_bookmarks WHERE parent = b.id) AS _childCount,
            p.parent AS _grandParentId
     FROM moz_bookmarks b
     LEFT JOIN moz_bookmarks p ON p.id = b.parent
     LEFT JOIN moz_places h ON h.id = b.fk
     WHERE b.guid = :guid
    ' (263387a0) should have been finalized before closing the connection: file /Users/ehsan/moz/src.landing/storage/src/mozStorageConnection.cpp, line 926
yes we need bug 1091851.
Depends on: 1091851
I'm hitting this at the end of reftest runs, starting today (or recently), too.

e.g. this command...
  ./mach reftest layout/reftests/z-index/
...gives me warning output similar to comment 0 at shutdown.

(In reply to Marco Bonardo [::mak] from comment #1)
> yes we need bug 1091851.

OK. (Just to be clear, in case it impacts whether or not that bug will actually help: I think this only started happening in the last day or so.)
Keywords: regression
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
yes we are using the new bookmarks API in more code, and that uses a wrapped connection that doesn't close soon enough. The only drawback is the warnings :(
Marco, these warnings are bothering me a lot, since I have to scroll past them to see the results of test runs hundreds of times every day.  Can we please disable them until this bug is fixed?
Flags: needinfo?(mak77)
It would require disabling all the Storage shutdown bugs... we have a patch pending review that I'll check on Monday, if that will require more days I'll look into a temporary solution.
Flags: needinfo?(mak77)
ehr s/bugs/warnings/
OK, thanks!
Attached patch patch v1 (obsolete) — Splinter Review
This isn't the right thing to do, but will shut up the warnings until we have the proper async shutdown in place.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a4a7b7c189fb
Assignee: nobody → mak77
Status: NEW → ASSIGNED
Attachment #8598604 - Flags: review?(ttaubert)
Attached patch patch v2Splinter Review
Move it later!
Attachment #8598604 - Attachment is obsolete: true
Attachment #8598604 - Flags: review?(ttaubert)
Attachment #8598697 - Flags: review?(ttaubert)
Attachment #8598697 - Flags: review?(ttaubert) → review+
https://hg.mozilla.org/mozilla-central/rev/456bf455bda4
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.