If there is quota error for some request, we send back an error response immediately without dispatching a task to database thread and waiting for result from database thread. However, web process expects to receive results for request in the order of requests being sent. One simple solution is to dispatch a task with the quota error to the background thread, to make sure requests are handled in order on the background thread.
Created attachment 380172 [details] Patch
Code change looks good. Test needs some polish.
Created attachment 380189 [details] Patch
Created attachment 380226 [details] Patch
Created attachment 380365 [details] Patch for landing
Comment on attachment 380365 [details] Patch for landing Clearing flags on attachment: 380365 Committed r250800: <https://trac.webkit.org/changeset/250800>
All reviewed patches have been landed. Closing bug.
<rdar://problem/56053633>