2011-11-21 08:10:03 +01:00
|
|
|
INCLUDES = -I$(top_builddir)/include \
|
|
|
|
-I$(top_srcdir)/include
|
|
|
|
|
2010-08-27 18:35:59 +02:00
|
|
|
LDADD = $(top_builddir)/src/libzmq.la
|
|
|
|
|
2010-08-28 13:58:23 +02:00
|
|
|
noinst_PROGRAMS = test_pair_inproc \
|
|
|
|
test_pair_tcp \
|
|
|
|
test_reqrep_inproc \
|
2011-01-30 11:51:30 +01:00
|
|
|
test_reqrep_tcp \
|
2011-06-22 11:02:16 +02:00
|
|
|
test_hwm \
|
2011-06-23 07:57:47 +02:00
|
|
|
test_reqrep_device \
|
2011-09-13 16:27:07 +02:00
|
|
|
test_sub_forward \
|
2011-11-06 14:03:51 +01:00
|
|
|
test_invalid_rep \
|
2012-02-02 14:56:51 +01:00
|
|
|
test_msg_flags \
|
2012-02-18 21:44:41 +01:00
|
|
|
test_connect_resolve \
|
After speaking with Ben Gray and the discussion on the mailing list, this is an attempt to create a sockopt to allow connecting pipes to not immediately be available for traffic. The problem is in a PUSH to many PULL situation, where there is a connect to a PULL which is not there. This connect will immediately create a pipe (unlike bind), and traffic will be load balanced to that pipe. This means if there is a persistently unavailable end point then the traffic will queue until HWM is hit, and older messages will be lost.
This patch adds a sockopt ZMQ_DELAY_ATTACH_ON_CONNECT, which if set to 1 will attempt to preempt this behavior. It does this by extending the use of the session_base to include in the outbound as well as the inbound pipe, and only associates the pipe with the socket once it receives the connected callback via a process_attach message. This works, and a test has been added to show so, but may introduce unexpected complications. The shutdown logic in this class has become marginally more awkward because of this, requiring the session to serve as the sink for both pipes if shutdown occurs with a still-connecting pipe in place. It is also possible there could be issues around flushing the messages, but as I could not directly think how to create such an issue I have not written any code with regards to that.
The documentation has been updated to reflect the change, but please do check over the code and test and review.
2012-06-01 18:58:19 +02:00
|
|
|
test_connect_delay \
|
2012-04-21 16:39:19 +02:00
|
|
|
test_last_endpoint \
|
2012-05-04 03:32:46 +02:00
|
|
|
test_term_endpoint \
|
|
|
|
test_monitor
|
2010-11-17 15:05:01 +01:00
|
|
|
|
|
|
|
if !ON_MINGW
|
2011-01-20 22:13:01 +01:00
|
|
|
noinst_PROGRAMS += test_shutdown_stress \
|
|
|
|
test_pair_ipc \
|
2011-06-20 07:35:24 +02:00
|
|
|
test_reqrep_ipc \
|
|
|
|
test_timeo
|
2010-11-17 15:05:01 +01:00
|
|
|
endif
|
2010-08-27 18:35:59 +02:00
|
|
|
|
2010-08-28 13:58:23 +02:00
|
|
|
test_pair_inproc_SOURCES = test_pair_inproc.cpp testutil.hpp
|
|
|
|
test_pair_tcp_SOURCES = test_pair_tcp.cpp testutil.hpp
|
|
|
|
test_reqrep_inproc_SOURCES = test_reqrep_inproc.cpp testutil.hpp
|
|
|
|
test_reqrep_tcp_SOURCES = test_reqrep_tcp.cpp testutil.hpp
|
2011-01-30 11:51:30 +01:00
|
|
|
test_hwm_SOURCES = test_hwm.cpp
|
2011-06-22 11:02:16 +02:00
|
|
|
test_reqrep_device_SOURCES = test_reqrep_device.cpp
|
2011-07-11 15:54:13 +02:00
|
|
|
test_sub_forward_SOURCES = test_sub_forward.cpp
|
2011-09-13 16:27:07 +02:00
|
|
|
test_invalid_rep_SOURCES = test_invalid_rep.cpp
|
2011-11-06 14:03:51 +01:00
|
|
|
test_msg_flags_SOURCES = test_msg_flags.cpp
|
2012-02-02 14:56:51 +01:00
|
|
|
test_connect_resolve_SOURCES = test_connect_resolve.cpp
|
After speaking with Ben Gray and the discussion on the mailing list, this is an attempt to create a sockopt to allow connecting pipes to not immediately be available for traffic. The problem is in a PUSH to many PULL situation, where there is a connect to a PULL which is not there. This connect will immediately create a pipe (unlike bind), and traffic will be load balanced to that pipe. This means if there is a persistently unavailable end point then the traffic will queue until HWM is hit, and older messages will be lost.
This patch adds a sockopt ZMQ_DELAY_ATTACH_ON_CONNECT, which if set to 1 will attempt to preempt this behavior. It does this by extending the use of the session_base to include in the outbound as well as the inbound pipe, and only associates the pipe with the socket once it receives the connected callback via a process_attach message. This works, and a test has been added to show so, but may introduce unexpected complications. The shutdown logic in this class has become marginally more awkward because of this, requiring the session to serve as the sink for both pipes if shutdown occurs with a still-connecting pipe in place. It is also possible there could be issues around flushing the messages, but as I could not directly think how to create such an issue I have not written any code with regards to that.
The documentation has been updated to reflect the change, but please do check over the code and test and review.
2012-06-01 18:58:19 +02:00
|
|
|
test_connect_delay_SOURCES = test_connect_delay.cpp
|
2012-02-18 21:44:41 +01:00
|
|
|
test_last_endpoint_SOURCES = test_last_endpoint.cpp
|
2012-04-21 16:39:19 +02:00
|
|
|
test_term_endpoint_SOURCES = test_term_endpoint.cpp
|
2012-05-04 03:32:46 +02:00
|
|
|
test_monitor_SOURCES = test_monitor.cpp
|
2011-06-22 11:02:16 +02:00
|
|
|
|
2010-11-17 15:05:01 +01:00
|
|
|
if !ON_MINGW
|
2010-10-01 16:03:08 +02:00
|
|
|
test_shutdown_stress_SOURCES = test_shutdown_stress.cpp
|
2011-01-20 22:13:01 +01:00
|
|
|
test_pair_ipc_SOURCES = test_pair_ipc.cpp testutil.hpp
|
|
|
|
test_reqrep_ipc_SOURCES = test_reqrep_ipc.cpp testutil.hpp
|
2011-06-20 07:35:24 +02:00
|
|
|
test_timeo_SOURCES = test_timeo.cpp
|
2010-11-17 15:05:01 +01:00
|
|
|
endif
|
2010-10-01 16:03:08 +02:00
|
|
|
|
2010-08-27 18:35:59 +02:00
|
|
|
TESTS = $(noinst_PROGRAMS)
|