-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Waiting the remaining tcp data are sent #4501
base: master
Are you sure you want to change the base?
Waiting the remaining tcp data are sent #4501
Conversation
ecbbe96
to
d97540e
Compare
496b146
to
a792221
Compare
a792221
to
bb174bc
Compare
jerry-ext/debugger/debugger-tcp.c
Outdated
@@ -144,6 +144,26 @@ jerryx_debugger_tcp_close (jerry_debugger_transport_header_t *header_p) /**< tcp | |||
|
|||
jerryx_debugger_transport_tcp_t *tcp_p = (jerryx_debugger_transport_tcp_t *) header_p; | |||
|
|||
/* Waiting the debug client close the tcp connection first */ | |||
for (;;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use while(true)
The problem is this loop might never ends.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, any suggestion? post here looking for suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use
while(true)
The problem is this loop might never ends.
maybe we doesn't need consider that, as when debugger stopping, means the debug client always closing the socket?
bb174bc
to
1078318
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about simply ignoring error 10054 on windows?
jerry-ext/debugger/debugger-tcp.c
Outdated
@@ -144,6 +144,26 @@ jerryx_debugger_tcp_close (jerry_debugger_transport_header_t *header_p) /**< tcp | |||
|
|||
jerryx_debugger_transport_tcp_t *tcp_p = (jerryx_debugger_transport_tcp_t *) header_p; | |||
|
|||
/* Waiting the debug client close the tcp connection first */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment: Waiting for the debug client close the tcp connection first.
jerry-ext/debugger/debugger-tcp.c
Outdated
{ | ||
/** | ||
* If result >= 0, this means that there is either data available on the socket, or the socket | ||
* has been closed. So waiting the socket closed by remote client by result == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part breaks the loop. Where is the 'waiting' part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== 0 means remote closed the tcp socket, > 0 means still have data, < 0 means have error, JERRYX_EWOULDBLOCK error should be ignored(means have no data but the tcp socket still there)
@zherczeg Just to clarify that's not only windows related issue. https://github.com/jerryscript-project/jerryscript/runs/1721915835#step:5:708 |
60eed79
to
18c2040
Compare
So that the tcp socket are closed by debugger client first and the debugger client won't receive socket are closed by remote error JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
18c2040
to
a2d7a70
Compare
I am still curious: [WinError 10054] An existing connection was forcibly closed by the remote host - this is a hint, not an error, why can't we simply ignore it? |
Are you talking about ignore the error in python side? |
In the restart debug case you are expecting a restart, it doesn't matter if it fails why it fails. A successful close does not guarantee that the restart will successful. So I still don't get why we cannot ignore this. |
As I said, we can not disinguish normal disconnection(restart instruction) or it's the jerry executable crash(cause connection reset). |
So that the tcp socket are closed by debugger client first and
the debugger client won't receive socket are closed by remote error
This is the random failure I am talking about:
https://github.com/jerryscript-project/jerryscript/runs/1721915835
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]