RESOLVED DUPLICATE of bug 208701 208700
Make ProcessThrottler::sendPrepareToSuspendIPC more robust to send failures
https://bugs.webkit.org/show_bug.cgi?id=208700
Summary Make ProcessThrottler::sendPrepareToSuspendIPC more robust to send failures
youenn fablet
Reported 2020-03-06 01:39:11 PST
Make ProcessThrottler::sendPrepareToSuspendIPC more robust to send failures
Attachments
Patch (3.60 KB, patch)
2020-03-06 01:42 PST, youenn fablet
no flags
youenn fablet
Comment 1 2020-03-06 01:39:31 PST
youenn fablet
Comment 2 2020-03-06 01:42:00 PST
youenn fablet
Comment 3 2020-03-06 01:55:57 PST
An alternative (or a related fix) would be to ensure AuxiliaryProcessProxy::sendMessage is calling the completion handler asynchronously in case of error. I do not think we loose much efficiency and this might get us safer.
youenn fablet
Comment 4 2020-03-06 02:02:55 PST
Chris Dumez
Comment 5 2020-03-06 08:53:26 PST
Comment on attachment 392690 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=392690&action=review > Source/WebKit/UIProcess/ProcessThrottler.cpp:185 > + setAssertionState(isSuspensionImminent == IsSuspensionImminent::Yes ? AssertionState::Suspended : AssertionState::Background); I am some worries in cases where isSuspensionImminent is true. The previous code already seemed a bit risky but now it seems even riskier. We release the process assertion for the child process *before* even sending the async IPC. The odds of the child process receiving the prepareToSuspend IPC before suspending are not good :/ I am trying to think of a better solution.
youenn fablet
Comment 6 2020-03-06 09:02:10 PST
(In reply to Chris Dumez from comment #5) > Comment on attachment 392690 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=392690&action=review > > > Source/WebKit/UIProcess/ProcessThrottler.cpp:185 > > + setAssertionState(isSuspensionImminent == IsSuspensionImminent::Yes ? AssertionState::Suspended : AssertionState::Background); > > I am some worries in cases where isSuspensionImminent is true. The previous > code already seemed a bit risky but now it seems even riskier. We release > the process assertion for the child process *before* even sending the async > IPC. The odds of the child process receiving the prepareToSuspend IPC before > suspending are not good :/ > > I am trying to think of a better solution. https://bugs.webkit.org/show_bug.cgi?id=208701 should fix the same issue as here by making sure to call the completion handler asynchronously. As of Imminent==Yes, I am not sure how much this will change things in practice.
Chris Dumez
Comment 7 2020-03-06 09:08:10 PST
(In reply to youenn fablet from comment #6) > (In reply to Chris Dumez from comment #5) > > Comment on attachment 392690 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=392690&action=review > > > > > Source/WebKit/UIProcess/ProcessThrottler.cpp:185 > > > + setAssertionState(isSuspensionImminent == IsSuspensionImminent::Yes ? AssertionState::Suspended : AssertionState::Background); > > > > I am some worries in cases where isSuspensionImminent is true. The previous > > code already seemed a bit risky but now it seems even riskier. We release > > the process assertion for the child process *before* even sending the async > > IPC. The odds of the child process receiving the prepareToSuspend IPC before > > suspending are not good :/ > > > > I am trying to think of a better solution. > > https://bugs.webkit.org/show_bug.cgi?id=208701 should fix the same issue as > here by making sure to call the completion handler asynchronously. > > As of Imminent==Yes, I am not sure how much this will change things in > practice. I prefer the other patch, seems less risky.
youenn fablet
Comment 8 2020-03-06 09:33:40 PST
*** This bug has been marked as a duplicate of bug 208701 ***
Note You need to log in before you can comment on or make changes to this bug.