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

Fix disappearing HTTP requests with the push/pull pipeline pattern in ZeroMQ #134

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/prime_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ server_t<request_container_t, request_info_t>::server_t(
uint32_t request_timeout,
const health_check_matcher_t& health_check_matcher,
const std::string& health_check_response)
: client(context, ZMQ_STREAM), proxy(context, ZMQ_DEALER), loopback(context, ZMQ_SUB),
: client(context, ZMQ_STREAM), proxy(context, ZMQ_DEALER), loopback(context, ZMQ_PULL),
interrupt(context, ZMQ_PUB), log(log), max_request_size(max_request_size),
request_timeout(request_timeout), request_id(0), health_check_matcher(health_check_matcher),
health_check_response(health_check_response.size(), health_check_response.data()) {
Expand All @@ -158,9 +158,6 @@ server_t<request_container_t, request_info_t>::server_t(
proxy.setsockopt(ZMQ_SNDHWM, &disabled, sizeof(disabled));
proxy.connect(proxy_endpoint.c_str());

// TODO: consider making this into a pull socket so we dont lose any results due to timing
loopback.setsockopt(ZMQ_RCVHWM, &disabled, sizeof(disabled));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert this line also for the same reason mentioned below

loopback.setsockopt(ZMQ_SUBSCRIBE, "", 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to set any options for push/pull sockets?

loopback.bind(result_endpoint.c_str());

interrupt.setsockopt(ZMQ_SNDHWM, &disabled, sizeof(disabled));
Expand Down Expand Up @@ -468,7 +465,7 @@ worker_t::worker_t(zmq::context_t& context,
const cleanup_function_t& cleanup_function,
const std::string& heart_beat)
: upstream_proxy(context, ZMQ_DEALER), downstream_proxy(context, ZMQ_DEALER),
loopback(context, ZMQ_PUB), interrupt(context, ZMQ_SUB), work_function(work_function),
loopback(context, ZMQ_PUSH), interrupt(context, ZMQ_SUB), work_function(work_function),
cleanup_function(cleanup_function), heart_beat_interval(5000), heart_beat(heart_beat),
job(std::numeric_limits<decltype(job)>::max()) {

Expand All @@ -482,7 +479,6 @@ worker_t::worker_t(zmq::context_t& context,
downstream_proxy.setsockopt(ZMQ_SNDHWM, &disabled, sizeof(disabled));
downstream_proxy.connect(downstream_proxy_endpoint.c_str());

loopback.setsockopt(ZMQ_SNDHWM, &disabled, sizeof(disabled));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should revert this in keeping with the rest of the design of the project. its better to let the application max out ram than to arbitrarily limit to 1k or whatever the default is

loopback.connect(result_endpoint.c_str());

interrupt.setsockopt(ZMQ_RCVHWM, &disabled, sizeof(disabled));
Expand Down