Assertion failed at tcp_listener.cpp:58

Description

Imagin we have lost connection to other side. libzmq starts reconnect process.

First connection attempt (made by zmq_connecter_t::start_connecting) calls tcp_connecter_t::open. Call to ::connect was unsuccessfull (for example, we've got WSAECONNREFUSED - port is closed). In this case execution will pass to the end of tcp_connecter_t::open and we will have ECONNREFUSED in errno variable.

In zmq_connecter_t::start_connecting, where we will return from tcp_connecter_t::open, execution will also pass to the end of it and reconnect timer will be activated.

When time arrives zmq_connecter_t::timer_event will be called, that itself will call zmq_connecter_t::start_connecting from which tcp_connecter.open will be called. But this time we will have actual socked ID in s variable because it was not closed after previous connection attempt!

In 3.x branch there is no such error because at the end of start_connections (just before enabling reconnect timer) close() method is called. Same should be done in 2.x branch.

Environment

Windows, Windows Mobile

Activity

Show:

PieterPFebruary 7, 2013 at 9:47 AM

OK, revised patch merged to 2-x branch and tested.

Boris GulayFebruary 6, 2013 at 10:10 PM

My mistake, sorry. Incorrect backport from 3.x branch.
New pull request here:
https://github.com/zeromq/zeromq2-x/pull/79

PieterPFebruary 6, 2013 at 9:07 PM

Fix causes assertion failure "s != retired_fd (tcp_connecter.cpp:271)"

  • reverted

PieterPFebruary 6, 2013 at 10:29 AM

Merged to 2.x branch.

Boris GulayFebruary 6, 2013 at 10:18 AM

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created February 6, 2013 at 10:05 AM
Updated February 7, 2013 at 9:47 AM
Resolved February 7, 2013 at 9:47 AM