Bug 54785 - When an IDBTransaction is aborted, all requests that have not yet fired should fire an ABORT_ERR
Summary: When an IDBTransaction is aborted, all requests that have not yet fired shoul...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Jeremy Orlow
URL:
Keywords:
Depends on: 55502
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-18 17:42 PST by Jeremy Orlow
Modified: 2011-03-01 15:55 PST (History)
10 users (show)

See Also:


Attachments
Patch (27.10 KB, patch)
2011-02-18 17:52 PST, Jeremy Orlow
no flags Details | Formatted Diff | Diff
Patch (28.92 KB, patch)
2011-02-22 16:04 PST, Jeremy Orlow
no flags Details | Formatted Diff | Diff
Patch (26.88 KB, patch)
2011-02-28 14:22 PST, Jeremy Orlow
steveblock: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Orlow 2011-02-18 17:42:46 PST
When an IDBTransaction is aborted, all requests that have not yet fired should fire an ABORT_ERR
Comment 1 Jeremy Orlow 2011-02-18 17:52:17 PST
Created attachment 83040 [details]
Patch
Comment 2 Jeremy Orlow 2011-02-18 17:52:52 PST
please review
Comment 3 Hans Wennborg 2011-02-21 01:34:14 PST
Comment on attachment 83040 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=83040&action=review

> LayoutTests/storage/indexeddb/transaction-abort.html:55
> +    request.onerror = firstAdd;

Maybe set onsuccess = unexpectedSuccessFeedback?

> LayoutTests/storage/indexeddb/transaction-abort.html:66
> +{

Assert that it's an ABORT_ERR?
Comment 4 David Grogan 2011-02-22 14:08:29 PST
Bugzilla won't let me submit this comment on the patch ("You are not authorized to edit attachment 83040 [details]."), but:

> Source/WebCore/storage/IDBRequest.cpp:226
> +    m_transaction->registerRequest(this);

What does this do?
It seems to be here so that if the SetVersion transaction aborts, the error handler on the request for a setversion transaction will be called.  But for the transaction to abort, wouldn't the setversion success handler have to already be called?  What am I missing?
Comment 5 Jeremy Orlow 2011-02-22 14:37:55 PST
(In reply to comment #3)
> (From update of attachment 83040 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=83040&action=review
> 
> > LayoutTests/storage/indexeddb/transaction-abort.html:55
> > +    request.onerror = firstAdd;
> 
> Maybe set onsuccess = unexpectedSuccessFeedback?

Good idea
 
> > LayoutTests/storage/indexeddb/transaction-abort.html:66
> > +{
> 
> Assert that it's an ABORT_ERR?

Good idea

(In reply to comment #4)
> Bugzilla won't let me submit this comment on the patch ("You are not authorized to edit attachment 83040 [details]."), but:
> 
> > Source/WebCore/storage/IDBRequest.cpp:226
> > +    m_transaction->registerRequest(this);
> 
> What does this do?
> It seems to be here so that if the SetVersion transaction aborts, the error handler on the request for a setversion transaction will be called.  But for the transaction to abort, wouldn't the setversion success handler have to already be called?  What am I missing?

Originally I asserted that if you unregistered something it had been registered before.  And we don't fire onError when aborting something that already fired an onSuccess.  So I believe it's OK as is, but probably a bit cleaner without.  Will change.
Comment 6 Jeremy Orlow 2011-02-22 16:04:10 PST
Created attachment 83406 [details]
Patch
Comment 7 James Robinson 2011-02-25 16:10:39 PST
Comment on attachment 83406 [details]
Patch

You have some spurious test_expectations.txt changes and conflicts that prevent EWS from running. Mind re-upping one without these?
Comment 8 Jeremy Orlow 2011-02-25 16:16:14 PST
I think the test_expectation change is a real issue...I couldn't run without it.  I can't upload a new one at the moment, but I will Monday.  The bots won't add much information though since this code only runs for Chromium.
Comment 9 Jeremy Orlow 2011-02-28 14:22:57 PST
Created attachment 84120 [details]
Patch
Comment 10 Jeremy Orlow 2011-02-28 14:26:52 PST
Nate's OOO and this is for m11, so if someone else could look, it'd be great.
Comment 11 Steve Block 2011-03-01 01:57:51 PST
Comment on attachment 84120 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=84120&action=review

> Source/WebCore/storage/IDBRequest.h:62
> +        EarlyDeath = 3

Why do you use a different style for this member of the enum?
Comment 12 Jeremy Orlow 2011-03-01 08:56:33 PST
(In reply to comment #11)
> (From update of attachment 84120 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=84120&action=review
> 
> > Source/WebCore/storage/IDBRequest.h:62
> > +        EarlyDeath = 3
> 
> Why do you use a different style for this member of the enum?

Because its proper webkit style.  The others match the IDL, but this isn't in IDL.  I can make it match if you think that's better though.

Thanks!
Comment 13 Steve Block 2011-03-01 09:01:00 PST
Comment on attachment 84120 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=84120&action=review

>>> Source/WebCore/storage/IDBRequest.h:62
>>> +        EarlyDeath = 3
>> 
>> Why do you use a different style for this member of the enum?
> 
> Because its proper webkit style.  The others match the IDL, but this isn't in IDL.  I can make it match if you think that's better though.
> 
> Thanks!

OK, makes sense. So while the request is in the EarlyDeath internal-only state, what state is reported to script? Or is this not relevant/possible?
Comment 14 Jeremy Orlow 2011-03-01 09:07:30 PST
(In reply to comment #13)
> (From update of attachment 84120 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=84120&action=review
> 
> >>> Source/WebCore/storage/IDBRequest.h:62
> >>> +        EarlyDeath = 3
> >> 
> >> Why do you use a different style for this member of the enum?
> > 
> > Because its proper webkit style.  The others match the IDL, but this isn't in IDL.  I can make it match if you think that's better though.
> > 
> > Thanks!
> 
> OK, makes sense. So while the request is in the EarlyDeath internal-only state, what state is reported to script? Or is this not relevant/possible?

Not possible.  That's why readyState() has this assert: ASSERT(m_readyState == LOADING || m_readyState == DONE);
Comment 15 Steve Block 2011-03-01 09:10:52 PST
Comment on attachment 84120 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=84120&action=review

>>>>> Source/WebCore/storage/IDBRequest.h:62
>>>>> +        EarlyDeath = 3
>>>> 
>>>> Why do you use a different style for this member of the enum?
>>> 
>>> Because its proper webkit style.  The others match the IDL, but this isn't in IDL.  I can make it match if you think that's better though.
>>> 
>>> Thanks!
>> 
>> OK, makes sense. So while the request is in the EarlyDeath internal-only state, what state is reported to script? Or is this not relevant/possible?
> 
> Not possible.  That's why readyState() has this assert: ASSERT(m_readyState == LOADING || m_readyState == DONE);

I see, makes sense. Maybe add a comment in the enum that the EarlyDeath value is internal only.
Comment 16 Jeremy Orlow 2011-03-01 12:42:33 PST
Committed r80028: <http://trac.webkit.org/changeset/80028>
Comment 17 WebKit Review Bot 2011-03-01 13:23:20 PST
http://trac.webkit.org/changeset/80028 might have broken Qt Linux Release
The following tests are not passing:
editing/deleting/4916235-1.html
editing/deleting/5390681.html
editing/deleting/5546763.html
editing/deleting/delete-3775172-fix.html
editing/deleting/delete-at-paragraph-boundaries-007.html
editing/deleting/delete-before-block-image-1.html
Comment 18 Jeremy Orlow 2011-03-01 13:32:55 PST
Caused regressions...need to fix up.
http://build.webkit.org/results/Windows%207%20Release%20(Tests)/r80028%20(9911)/results.html
http://build.webkit.org/results/Windows%207%20Release%20(Tests)/r80028%20(9911)/editing/deleting/6026335-crash-log.txt

FAULTING_SOURCE_CODE:  
   100:     ASSERT_UNUSED(wasAdded, wasAdded); // It should not have already been in the list.
   101: 
   102:     while (!m_queuedEvents.isEmpty()) {
   103:         ListHashSet<RefPtr<Event> >::iterator iter = m_queuedEvents.begin();
>  104:         RefPtr<Event> event = *iter;
   105:         m_queuedEvents.remove(iter);
   106:         if (!event)
   107:             break;
   108:         dispatchEvent(event.get());
   109:     }
Comment 19 Jeremy Orlow 2011-03-01 15:55:51 PST
Committed r80055: <http://trac.webkit.org/changeset/80055>