geniusgao / libevent-longpolling

Automatically exported from code.google.com/p/libevent-longpolling
0 stars 0 forks source link

Message loss #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. wget http://127.0.0.1:8888/consumer/queue
2. Ctrl+C
3. curl -H "Content-Type: text/plain" -d "will be lost"
http://127.0.0.1:8888/producer/queue
4. wget http://127.0.0.1:8888/consumer/queue

What is the expected output? What do you see instead?
A message shall be delivered to the second consumer, but it is instead lost
in a try to send it to disconnected consumer.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by guillaum...@gmail.com on 4 Sep 2009 at 5:08

GoogleCodeExporter commented 9 years ago
libevent does not give a synchronous status when calling evhttp_send_reply.

A close callback, when properly set using evhttp_connection_set_closecb, is 
called
asynchronously i.e. after function calling evhttp_send_reply returned.

Message that was attempted to be sent to consumer shall not be freed directly 
after
calling evhttp_send_reply. It can be removed from topic queue safely yet.

If consumer gave up waiting for notifications, message removed from topic queue 
can
be put in front of topic. Upon call of _consumer_pull, pending message shall be 
freed.

Original comment by guillaum...@gmail.com on 4 Sep 2009 at 6:09