Bug 232508

Summary: Improve error handling in sendWithAsyncReply()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, darin, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2021-10-29 14:52:19 PDT
Improve error handling in sendWithAsyncReply().
Comment 1 Chris Dumez 2021-10-29 14:58:14 PDT
Created attachment 442866 [details]
Patch
Comment 2 Darin Adler 2021-10-29 15:05:15 PDT
Comment on attachment 442866 [details]
Patch

Should we test this?
Comment 3 Chris Dumez 2021-10-29 15:09:26 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 442866 [details]
> Patch
> 
> Should we test this?

We'd need a way to keep the IPC::Connection object alive after we've invalidated it.
If the IPC::Connection object gets destroyed promptly, then there is no issue since its destructor will call the async reply handlers.

I noticed this when working on another patch where I mistakenly leaked a Connection object and one test was timing out because the sendWithAsyncReply() completion handler was never getting called.

I will see if there is an easy way to write a test for this but it is not super trivial.
Comment 4 Chris Dumez 2021-10-29 16:27:55 PDT
Created attachment 442879 [details]
Patch
Comment 5 Chris Dumez 2021-10-29 16:28:37 PDT
(In reply to Chris Dumez from comment #4)
> Created attachment 442879 [details]
> Patch

I added an API test.
Comment 6 EWS 2021-10-30 18:24:45 PDT
Committed r285086 (243728@main): <https://commits.webkit.org/243728@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442879 [details].
Comment 7 Radar WebKit Bug Importer 2021-10-30 18:25:17 PDT
<rdar://problem/84844843>