Bug 217353 - [WinCairo][PlayStation] Add handling for accept failure case
Summary: [WinCairo][PlayStation] Add handling for accept failure case
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-05 16:46 PDT by Basuke Suzuki
Modified: 2020-10-30 14:23 PDT (History)
16 users (show)

See Also:


Attachments
PATCH (15.50 KB, patch)
2020-10-06 14:41 PDT, Basuke Suzuki
no flags Details | Formatted Diff | Diff
PATCH (15.31 KB, patch)
2020-10-27 15:41 PDT, Basuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Basuke Suzuki 2020-10-05 16:46:34 PDT
When listening RemoteInspectorServer fails to accept new connection, the listening socket goes to invalid situation and need to be recreated from the scrach.
Comment 1 Basuke Suzuki 2020-10-06 14:41:50 PDT
Created attachment 410695 [details]
PATCH
Comment 2 Ross Kirsling 2020-10-06 18:44:22 PDT
Comment on attachment 410695 [details]
PATCH

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

Just some naming comments from me.

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.h:50
> -    void didClose(RemoteInspectorSocketEndpoint&, ConnectionID) final { };
> +    void didStatusChanged(RemoteInspectorSocketEndpoint&, ConnectionID, RemoteInspectorSocketEndpoint::Listener::Status) final { };

This should be `didChangeStatus`.

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h:168
> +        bool isTimeToListen()

I think `shouldListen` would be better.

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h:176
> +        MonotonicTime postponeRetryUntil { MonotonicTime::nan() };

How about something like `nextRetryTime`?
Comment 3 Basuke Suzuki 2020-10-07 00:08:59 PDT
(In reply to Ross Kirsling from comment #2)
> Comment on attachment 410695 [details]
> PATCH
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=410695&action=review
> 
> Just some naming comments from me.
> 
> > Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.h:50
> > -    void didClose(RemoteInspectorSocketEndpoint&, ConnectionID) final { };
> > +    void didStatusChanged(RemoteInspectorSocketEndpoint&, ConnectionID, RemoteInspectorSocketEndpoint::Listener::Status) final { };
> 
> This should be `didChangeStatus`.
> 
> > Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h:168
> > +        bool isTimeToListen()
> 
> I think `shouldListen` would be better.
> 
> > Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h:176
> > +        MonotonicTime postponeRetryUntil { MonotonicTime::nan() };
> 
> How about something like `nextRetryTime`?

Thanks!
Comment 4 Alex Christensen 2020-10-08 17:21:24 PDT
Comment on attachment 410695 [details]
PATCH

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

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp:113
> +    MonotonicTime mostRecentWakeup = MonotonicTime::nan();

Let's not use nan as a sentinel.  Please use Optional<MonotonicTime> instead.

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h:55
> +        enum class Status {

: uint8_t
Comment 5 Basuke Suzuki 2020-10-14 10:52:28 PDT
Comment on attachment 410695 [details]
PATCH

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

Thanks for reviewing!

>> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp:113
>> +    MonotonicTime mostRecentWakeup = MonotonicTime::nan();
> 
> Let's not use nan as a sentinel.  Please use Optional<MonotonicTime> instead.

Ah, that's better. Thanks

>> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h:55
>> +        enum class Status {
> 
> : uint8_t

Oh my. I don't know why but I misunderstand the behavior of enum class's underlying type decision. For unscoped enum, it is always int when it is unspecified, but for scoped, I believed it is calculated to be the minimum to hold the values. I might be confusing with other specification. thanks.
Comment 6 Basuke Suzuki 2020-10-27 15:41:32 PDT
Created attachment 412468 [details]
PATCH
Comment 7 Alex Christensen 2020-10-28 16:48:00 PDT
Comment on attachment 412468 [details]
PATCH

I wish there were a way to make this more straightforward.
Comment 8 EWS 2020-10-28 16:51:50 PDT
Committed r269128: <https://trac.webkit.org/changeset/269128>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412468 [details].
Comment 9 Radar WebKit Bug Importer 2020-10-28 16:52:17 PDT
<rdar://problem/70786493>
Comment 10 Basuke Suzuki 2020-10-30 12:58:51 PDT
(In reply to Alex Christensen from comment #7)
> Comment on attachment 412468 [details]
> PATCH
> 
> I wish there were a way to make this more straightforward.

Thanks for reviewing!

Do you mean something like socket abstraction layer?
Comment 11 Alex Christensen 2020-10-30 14:23:46 PDT
I'm not completely sure what I mean.  I think there should be a better abstraction somewhere, but I'm not sure what would make this more straightforward.