[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2014-07-04 Thread Xavier de Gaye
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. --

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2014-06-27 Thread STINNER Victor
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2014-06-27 Thread François-Xavier Bourlet
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2014-06-21 Thread Mark Lawrence
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-04 Thread Xavier de Gaye
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:

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-04 Thread Giampaolo Rodola'
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 -

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-03 Thread Xavier de Gaye
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-03 Thread Charles-François Natali
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +giampaolo.rodola, josiahcarlson, stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12498 ___

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-03 Thread Giampaolo Rodola'
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-03 Thread Xavier de Gaye
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-03 Thread Xavier de Gaye
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-03 Thread Xavier de Gaye
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. --

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-02 Thread Charles-François Natali
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-11-02 Thread Xavier de Gaye
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 ___

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-10-30 Thread Charles-François Natali
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'

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-10-30 Thread Xavier de Gaye
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-10-30 Thread Xavier de Gaye
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-10-30 Thread Charles-François Natali
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-10-30 Thread Xavier de Gaye
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 ___

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-10-30 Thread Xavier de Gaye
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,

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-10-30 Thread Charles-François Natali
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-10-30 Thread Xavier de Gaye
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:

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-10-29 Thread Xavier de Gaye
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-08-03 Thread François-Xavier Bourlet
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-07-24 Thread Charles-François Natali
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-07-24 Thread Charles-François Natali
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

[issue12498] asyncore.dispatcher_with_send, disconnection problem + miss-conception

2011-07-04 Thread François-Xavier Bourlet
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