Xavier de Gaye added the comment:
Sorry Xavier for your patches, but it's time to focus our efforts on a single
module and asyncio has a much better design to handle such use cases.
No problem. Thanks for taking your time to review patches made on this old
module.
--
STINNER Victor added the comment:
Actually the class asyncore.dispatcher_with_send do not handle properly
disconnection. When the endpoint shutdown his sending part of the socket, but
keep the socket open in reading, the current implementation of
dispatcher_with_send will close the socket
François-Xavier Bourlet added the comment:
No worries, I am glad to see asyncore going away. It was indeed badly
designed in the first place.
--
François-Xavier Bourlet
On Fri, Jun 27, 2014 at 2:28 PM, STINNER Victor rep...@bugs.python.org wrote:
STINNER Victor added the comment:
Actually
Mark Lawrence added the comment:
Other asyncore issues have been closed as won't fix as it's been deprecated
in favour of asyncio. I assume the same applies here.
--
nosy: +BreamoreBoy
___
Python tracker rep...@bugs.python.org
Xavier de Gaye xdeg...@gmail.com added the comment:
Attached yet another patch.
This patch does not use a while loop in handle_close() and handles
POLLHUP as suggested by Charles-François. No changes have been made to
both tests (test_half_duplex_close).
--
Added file:
Giampaolo Rodola' g.rod...@gmail.com added the comment:
I think this thread is becoming a little messy and since asyncore/asynchat are
in a situation where even the slightest change can break existent code I
recommend to be really careful.
I see 3 different issues here:
1 -
Xavier de Gaye xdeg...@gmail.com added the comment:
Attached is a new patch following the code review.
After rewriting the asyncore test to check that the data has been
successfully received by the client, the test fails when
using poll() and a data size of 4096 bytes. The reason is that when
Charles-François Natali neolo...@free.fr added the comment:
The reason is that when TestHandler closes the connection after
writing the output buffer, the client receives a POLLHUP which
prevents it to receive the data since POLLHUP is triggering a call to
handle_close.
Yes, that's the
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +giampaolo.rodola, josiahcarlson, stutzbach
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12498
___
Giampaolo Rodola' g.rod...@gmail.com added the comment:
Follow my comments about half_duplex_close.diff (current latest patch).
+def handle_close(self):
+if not self._closing:
+self._closing = True
+# try to drain the output buffer
+while
Xavier de Gaye xdeg...@gmail.com added the comment:
I think the best would be to not handle POLLHUP events while POLLIN
is set, so that the handlers can have a chance to drain the input
socket buffer.
Ok.
But it's a separate issue, could you create a new one?
The test case fails if the
Xavier de Gaye xdeg...@gmail.com added the comment:
Follow my comments about half_duplex_close.diff (current latest patch).
+def handle_close(self):
+if not self._closing:
+self._closing = True
+# try to drain the output buffer
+while
Xavier de Gaye xdeg...@gmail.com added the comment:
this is the handling of a half-duplex disconnection on the remote
side ?
Actually this is not the handling of a half-duplex disconnection on the
remote side, but we need a half-duplex disconnection to test it.
--
Charles-François Natali neolo...@free.fr added the comment:
I've done a review of your patch (looks like Rietveld doesn't send emails).
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12498
Xavier de Gaye xdeg...@gmail.com added the comment:
Review done after Charles-François review.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12498
___
Charles-François Natali neolo...@free.fr added the comment:
This does not seem to work.
Yes, the proposed fix is buggy: the solution is to drain the output
buffer, guarding against recursive calls between send() and
handle_close() (patch attached).
Note that after the first 'handle_close'
Xavier de Gaye xdeg...@gmail.com added the comment:
Thanks for the explanations.
I confirm that the patch fixes 'asyncore_12498.py' with your changes
applied to this script.
Note that the patch may break applications that have given different
semantics to 'closing' ('closing' being such a
Xavier de Gaye xdeg...@gmail.com added the comment:
Note that the patch may break applications that have given different
semantics to 'closing' ('closing' being such a common name for a
network application) after they noticed that this attribute is never
used by asyncore nor by asynchat.
I
Charles-François Natali neolo...@free.fr added the comment:
The attached patch uses another name
In that case, you should use a name starting with an underscore
(private namespace).
and drains the output buffer only on a close event, not on error conditions.
Hmmm...
I don't think it's a
Changes by Xavier de Gaye xdeg...@gmail.com:
Added file: http://bugs.python.org/file23559/asyncore_shutdown.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12498
___
Xavier de Gaye xdeg...@gmail.com added the comment:
While writing the test case, I found out that the test case does not
fail before the patch. It seems that draining the output buffer
already works:
The attached script 'asyncore_shutdown.py' drains the output buffer
when run without the patch,
Charles-François Natali neolo...@free.fr added the comment:
While writing the test case, I found out that the test case does not
fail before the patch. It seems that draining the output buffer
already works:
The attached script 'asyncore_shutdown.py' drains the output buffer
when run
Xavier de Gaye xdeg...@gmail.com added the comment:
That's because you didn't define a handle_read() method
Ooops...
Attached is a patch for dispatcher_with_send and asynchat with a test
case for each, that fail when the fix is not applied.
--
Added file:
Xavier de Gaye xdeg...@gmail.com added the comment:
Actually the class asyncore.dispatcher_with_send do not handle
properly disconnection. When the endpoint shutdown his sending part
of the socket, but keep the socket open in reading, the current
implementation of dispatcher_with_send will
François-Xavier Bourlet bomb...@gmail.com added the comment:
I am currently busy, but i will try to allocate some time to propose a
path soon.
Cheers,
2011/7/24 Charles-François Natali rep...@bugs.python.org:
Charles-François Natali neolo...@free.fr added the comment:
Hello,
Actually the
Charles-François Natali neolo...@free.fr added the comment:
Hello,
Actually the class asyncore.dispatcher_with_send do not handle properly
disconnection. When the endpoint shutdown his sending part of the socket,
but keep the socket open in reading, the current implementation of
Changes by Charles-François Natali neolo...@free.fr:
--
components: +Library (Lib) -IO
stage: - needs patch
type: - behavior
versions: +Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12498
New submission from François-Xavier Bourlet bomb...@gmail.com:
Actually the class asyncore.dispatcher_with_send do not handle properly
disconnection. When the endpoint shutdown his sending part of the socket, but
keep the socket open in reading, the current implementation of
28 matches
Mail list logo