Bug 232508 - Improve error handling in sendWithAsyncReply()
Summary: Improve error handling in sendWithAsyncReply()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-29 14:52 PDT by Chris Dumez
Modified: 2021-10-30 18:25 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.97 KB, patch)
2021-10-29 14:58 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (7.16 KB, patch)
2021-10-29 16:27 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>