Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Drew Wilson
This discussion reminds me of a similar issue with MessagePorts. The original MessagePort spec exposed GC behavior through the use of onclose events/closed attributes on MessagePorts. It turns out that on Chromium, there are situations where it's very difficult for us to GC MessagePorts (a port's

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Jeremy Orlow
On Wed, Feb 9, 2011 at 11:05 AM, Drew Wilson atwil...@google.com wrote: This discussion reminds me of a similar issue with MessagePorts. The original MessagePort spec exposed GC behavior through the use of onclose events/closed attributes on MessagePorts. It turns out that on Chromium, there

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Drew Wilson
On Wed, Feb 9, 2011 at 11:20 AM, Jeremy Orlow jor...@chromium.org wrote: On Wed, Feb 9, 2011 at 11:05 AM, Drew Wilson atwil...@google.com wrote: This discussion reminds me of a similar issue with MessagePorts. The original MessagePort spec exposed GC behavior through the use of onclose

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Glenn Maynard
On Wed, Feb 9, 2011 at 2:05 PM, Drew Wilson atwil...@google.com wrote: This discussion reminds me of a similar issue with MessagePorts. The original MessagePort spec exposed GC behavior through the use of onclose events/closed attributes on MessagePorts. It turns out that on Chromium, there

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Jonas Sicking
On Wed, Feb 9, 2011 at 11:05 AM, Drew Wilson atwil...@google.com wrote: This discussion reminds me of a similar issue with MessagePorts. The original MessagePort spec exposed GC behavior through the use of onclose events/closed attributes on MessagePorts. It turns out that on Chromium, there

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Drew Wilson
In some cases we leak them, yes (they live for the life of the parent context) if the developer does not close them. Typically this is only when you've cloned a MessagePort and sent the other end to a different process. Trying to figure out if a port is reachable when the entangled port lives in a

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Drew Wilson
On Wed, Feb 9, 2011 at 2:03 PM, Jonas Sicking jo...@sicking.cc wrote: For what it's worth, shared workers already expose GC behavior. You'll get a already-existing shared worker, or a new one will be created, depending on if GC has collected the worker or not. Hmmm. That was certainly not

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Glenn Maynard
On Wed, Feb 9, 2011 at 5:05 PM, Drew Wilson atwil...@google.com wrote: In some cases we leak them, yes (they live for the life of the parent context) if the developer does not close them. Typically this is only when you've cloned a MessagePort and sent the other end to a different process.

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Jonas Sicking
On Wed, Feb 9, 2011 at 5:26 PM, Glenn Maynard gl...@zewt.org wrote: Another related issue: what happens if a long-running number-cruncher worker keeps a database open while it works, to read data or output results? There's no API for sending versionchange events for IDBDatabaseSync, and it

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Glenn Maynard
On Wed, Feb 9, 2011 at 8:39 PM, Jonas Sicking jo...@sicking.cc wrote: On Wed, Feb 9, 2011 at 5:26 PM, Glenn Maynard gl...@zewt.org wrote: Another related issue: what happens if a long-running number-cruncher worker keeps a database open while it works, to read data or output results?

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-09 Thread Jonas Sicking
On Wed, Feb 9, 2011 at 6:12 PM, Glenn Maynard gl...@zewt.org wrote: On Wed, Feb 9, 2011 at 8:39 PM, Jonas Sicking jo...@sicking.cc wrote: On Wed, Feb 9, 2011 at 5:26 PM, Glenn Maynard gl...@zewt.org wrote: Another related issue: what happens if a long-running number-cruncher worker keeps

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jonas Sicking
On Mon, Feb 7, 2011 at 8:09 PM, Jeremy Orlow jor...@chromium.org wrote: We're currently implementing the onblocked/setVersion semantics and ran into an interesting problem: if you don't call .close() on a database and simply expect it to be collected, then you ever being able to run a

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread João Eiras
The only solution I can think of is to require (or recommend) that implementations run the garbage collector in a context after firing the versionchange event if the database still isn't closed. This should be a rare occurrence simply because setVersion should be rare. That would be a hack

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jonas Sicking
On Tue, Feb 8, 2011 at 2:45 AM, João Eiras joao.ei...@gmail.com wrote: The only solution I can think of is to require (or recommend) that implementations run the garbage collector in a context after firing the versionchange event if the database still isn't closed. This should be a rare

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread João Eiras
On Tue, Feb 8, 2011 at 10:52 AM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 8, 2011 at 2:45 AM, João Eiras joao.ei...@gmail.com wrote: The only solution I can think of is to require (or recommend) that implementations run the garbage collector in a context after firing the versionchange

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jonas Sicking
On Tue, Feb 8, 2011 at 3:20 AM, João Eiras joao.ei...@gmail.com wrote: On Tue, Feb 8, 2011 at 10:52 AM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 8, 2011 at 2:45 AM, João Eiras joao.ei...@gmail.com wrote: The only solution I can think of is to require (or recommend) that

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jonas Sicking
On Tue, Feb 8, 2011 at 3:26 AM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 8, 2011 at 3:20 AM, João Eiras joao.ei...@gmail.com wrote: On Tue, Feb 8, 2011 at 10:52 AM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 8, 2011 at 2:45 AM, João Eiras joao.ei...@gmail.com wrote: The only

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread João Eiras
Unless by certain GC behavior mean I referred to # The only solution I can think of is to require (or recommend) that implementations run the garbage collector The GC is transparent and a spec cannot expect that it runs at specific times or demand it.

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jeremy Orlow
On Tue, Feb 8, 2011 at 3:36 AM, João Eiras joao.ei...@gmail.com wrote: Unless by certain GC behavior mean I referred to # The only solution I can think of is to require (or recommend) that implementations run the garbage collector The GC is transparent and a spec cannot expect that it

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jonas Sicking
On Tue, Feb 8, 2011 at 9:26 AM, Jeremy Orlow jor...@chromium.org wrote: On Tue, Feb 8, 2011 at 3:36 AM, João Eiras joao.ei...@gmail.com wrote: Unless by certain GC behavior mean I referred to # The only solution I can think of is to require (or recommend) that implementations run the

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jeremy Orlow
On Tue, Feb 8, 2011 at 10:36 AM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 8, 2011 at 9:26 AM, Jeremy Orlow jor...@chromium.org wrote: On Tue, Feb 8, 2011 at 3:36 AM, João Eiras joao.ei...@gmail.com wrote: Unless by certain GC behavior mean I referred to # The only

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread ben turner
I'm actually fine with keeping the setVersion from proceeding until the old database is collected. First, this is probably a bug in the web page, and the page should be fixed. Second, the new database that is waiting for setVersion to proceed will get an onblocked event, so the page should know

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jonas Sicking
2011/2/8 Jeremy Orlow jor...@chromium.org: On Tue, Feb 8, 2011 at 10:36 AM, Jonas Sicking jo...@sicking.cc wrote: On Tue, Feb 8, 2011 at 9:26 AM, Jeremy Orlow jor...@chromium.org wrote: On Tue, Feb 8, 2011 at 3:36 AM, João Eiras joao.ei...@gmail.com wrote: Unless by certain GC behavior

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Shawn Wilsher
On 2/8/2011 11:51 AM, ben turner wrote: I'm actually fine with keeping the setVersion from proceeding until the old database is collected. First, this is probably a bug in the web page, and the page should be fixed. Second, the new database that is waiting for setVersion to proceed will get an

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jeremy Orlow
On Tue, Feb 8, 2011 at 3:31 PM, Glenn Maynard gl...@zewt.org wrote: On Tue, Feb 8, 2011 at 4:01 PM, Jeremy Orlow jor...@chromium.org wrote: I talked it over with Darin (Fisher), and he largely agreed with you guys. I'll file a bug saying that after unload, all IDBDatabases attached to that

Re: [IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-08 Thread Jonas Sicking
On Tue, Feb 8, 2011 at 3:31 PM, Glenn Maynard gl...@zewt.org wrote: On Tue, Feb 8, 2011 at 4:01 PM, Jeremy Orlow jor...@chromium.org wrote: I talked it over with Darin (Fisher), and he largely agreed with you guys.  I'll file a bug saying that after unload, all IDBDatabases attached to that

[IndexedDB] setVersion blocked on uncollected garbage IDBDatabases

2011-02-07 Thread Jeremy Orlow
We're currently implementing the onblocked/setVersion semantics and ran into an interesting problem: if you don't call .close() on a database and simply expect it to be collected, then you ever being able to run a setVersion transaction is at the mercy of the garbage collecter doing a collection.