Skip to content
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

Client not handling disconnections on write #12

Open
ejsmont-artur opened this issue Jul 16, 2012 · 6 comments
Open

Client not handling disconnections on write #12

ejsmont-artur opened this issue Jul 16, 2012 · 6 comments

Comments

@ejsmont-artur
Copy link

Hi there

Sorry for so many bad news :) Another use case is when server disconnects after connection is established and before message is sent.

I create a loop of 100K messages to be sent and right after i kick it off i kill the server. Client dies with a stack smash:

PHP Fatal error:  Maximum function nesting level of '100' reached, aborting! in /home/aejsmont/svn/hacks/stomp/Stomp.php on line 599
PHP Stack trace:
PHP   1. {main}() /home/aejsmont/svn/hacks/stomp/topicSenderLoop.php:0
PHP   2. Stomp->send() /home/aejsmont/svn/hacks/stomp/topicSenderLoop.php:32
PHP   3. Stomp->_writeFrame() /home/aejsmont/svn/hacks/stomp/Stomp.php:256
PHP   4. Stomp->_reconnect() /home/aejsmont/svn/hacks/stomp/Stomp.php:497
PHP   5. Stomp->connect() /home/aejsmont/svn/hacks/stomp/Stomp.php:599
PHP   6. Stomp->_makeConnection() /home/aejsmont/svn/hacks/stomp/Stomp.php:190
PHP   7. Stomp->disconnect() /home/aejsmont/svn/hacks/stomp/Stomp.php:140
PHP   8. Stomp->_writeFrame() /home/aejsmont/svn/hacks/stomp/Stomp.php:472
PHP   9. Stomp->_reconnect() /home/aejsmont/svn/hacks/stomp/Stomp.php:497
PHP  10. Stomp->connect() /home/aejsmont/svn/hacks/stomp/Stomp.php:599
PHP  11. Stomp->_makeConnection() /home/aejsmont/svn/hacks/stomp/Stomp.php:190
PHP  12. Stomp->disconnect() /home/aejsmont/svn/hacks/stomp/Stomp.php:140
PHP  13. Stomp->_writeFrame() /home/aejsmont/svn/hacks/stomp/Stomp.php:472
PHP  14. Stomp->_reconnect() /home/aejsmont/svn/hacks/stomp/Stomp.php:497
PHP  15. Stomp->connect() /home/aejsmont/svn/hacks/stomp/Stomp.php:599
PHP  16. Stomp->_makeConnection() /home/aejsmont/svn/hacks/stomp/Stomp.php:190
PHP  17. Stomp->disconnect() /home/aejsmont/svn/hacks/stomp/Stomp.php:140
PHP  18. Stomp->_writeFrame() /home/aejsmont/svn/hacks/stomp/Stomp.php:472
PHP  19. Stomp->_reconnect() /home/aejsmont/svn/hacks/stomp/Stomp.php:497
PHP  20. Stomp->connect() /home/aejsmont/svn/hacks/stomp/Stomp.php:599
PHP  21. Stomp->_makeConnection() /home/aejsmont/svn/hacks/stomp/Stomp.php:190
PHP  22. Stomp->disconnect() /home/aejsmont/svn/hacks/stomp/Stomp.php:140
PHP  23. Stomp->_writeFrame() /home/aejsmont/svn/hacks/stomp/Stomp.php:472
PHP  24. Stomp->_reconnect() /home/aejsmont/svn/hacks/stomp/Stomp.php:497
PHP  25. Stomp->connect() /home/aejsmont/svn/hacks/stomp/Stomp.php:599
PHP  26. Stomp->_makeConnection() /home/aejsmont/svn/hacks/stomp/Stomp.php:190

Thanks

Art

@marklr
Copy link

marklr commented Jul 16, 2012

Do you have any suggestions on how you'd add buffering messages that need to be sent post-reconnection?

@ejsmont-artur
Copy link
Author

Well I did not even expect to have this in place. I thought throwing
exception and flagging connection as lost would do so that client of the
lib could decide what to do :)

I guess reconnection count could be a custom param as next step.

Thanks
On Jul 17, 2012 12:47 AM, "marklr" <
reply@reply.github.com>
wrote:

Do you have any suggestions on how you'd add buffering messages that need
to be sent post-reconnection?


Reply to this email directly or view it on GitHub:
#12 (comment)

@marklr
Copy link

marklr commented Jul 17, 2012

I think the optimal solution would be to buffer (in _writeFrame()) and if we pass a threshold of failed reconnects, then throw an exception. Otherwise, just dump it all once we're reconnected.

@abrown28
Copy link

I've encountered the same problem when trying to test failover except in my case it locked up my ubuntu machine and I had to hard boot it. Might want to add a delay before trying to reconnect ;)

@abrown28
Copy link

any idea if you are going to fix this? Issue was raised 11 months ago.

@monofone
Copy link
Collaborator

Yes I like to but I´m out of time and have no running project where I use the client at the moment. So my afford to fix this is not this big.
But If you provide me some testcode to reproduce the error I can take a look. But I won´t promise a solution in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants