Re: [zeromq-dev] Role of iMatix in ZeroMQ community

2016-04-19 Thread Stephen Hemminger
On Tue, 19 Apr 2016 05:07:05 +0200
Pieter Hintjens  wrote:

> I trust Eben's judgement 100%
> On 19 Apr 2016 02:34, "Michel Pelletier"  wrote:
> 
> > I love reading Eben's work, thanks Stephen.

I was upset with LF before reading this. Now my opinion is that LF is really
in a caretaker/landlord role, and it is up toe the members/clients to take
on any advocacy required.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Role of iMatix in ZeroMQ community

2016-04-18 Thread Stephen Hemminger
On Mon, 18 Apr 2016 14:46:19 -0700
Michel Pelletier  wrote:

> The Linux Foundation's CII looks appropriate:
> 
> https://applications.coreinfrastructure.org/
> 
> I think it would be worth speaking with them before applying to see if they
> agree on the fit.  Anyone have a better contact?  At least on my end their
> contact page is just a link to the FAQ.
> 

The people to talk to are:
  Laura Kempke 
  Michael Dolan 
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Role of iMatix in ZeroMQ community

2016-04-18 Thread Stephen Hemminger
On Mon, 18 Apr 2016 23:58:44 +0200
Benjamin Henrion  wrote:

> On Mon, Apr 18, 2016 at 11:39 PM, Stephen Hemminger
>  wrote:
> > On Mon, 18 Apr 2016 21:39:35 +0200
> > Pieter Hintjens  wrote:
> >
> >> Hi folks,
> >>
> >> I learned today that I'm terminally ill with lung cancer. Metastasis from
> >> an incident five years ago. iMatix has run for 20 years and today consists
> >> of myself as only active resource. This means we need to remove my firm as
> >> a dependency.
> >>
> >> Suggestions for a safe long term home for the domain names, if you would.
> >>
> >> Pieter
> >
> > An obvious choice would be at Linux Foundation under the core infrastructure
> > initiative.
> 
> Linux Foundation does not rate very high on my list:
> 
> http://techrights.org/2016/01/21/linux-foundation-coup/
> 

Read this
  https://www.softwarefreedom.org/blog/2016/apr/11/lf/
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Role of iMatix in ZeroMQ community

2016-04-18 Thread Stephen Hemminger
On Mon, 18 Apr 2016 21:39:35 +0200
Pieter Hintjens  wrote:

> Hi folks,
> 
> I learned today that I'm terminally ill with lung cancer. Metastasis from
> an incident five years ago. iMatix has run for 20 years and today consists
> of myself as only active resource. This means we need to remove my firm as
> a dependency.
> 
> Suggestions for a safe long term home for the domain names, if you would.
> 
> Pieter

An obvious choice would be at Linux Foundation under the core infrastructure
initiative. 
  https://www.coreinfrastructure.org/

Also, it would not be hard to get hosting/email resources over at kernel.org.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Fundamental perks?

2015-05-15 Thread Stephen Hemminger
On Thu, 14 May 2015 09:34:33 -0400
Kenneth Adam Miller  wrote:

> But our use case still needs to communicate between processes in the new 
> model proposed. The idea is for regular raw sockets to be used to communicate 
> between processes, because this would be the only communication, and the 
> linux kernel would automatically replace any localhost communication with 
> inter process communication (?)

That is not true. localhost communication on Linux still goes through TCP.
Solaris did that at one point, and there were research projects to do localhost
passthrough, but it has a whole lot of corner cases which meant it never went
into upstream and any distro I know of.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] CurveZMQ non-technical issues

2015-04-20 Thread Stephen Hemminger
Is anyone doing anything about CurveZMQ and compliance?

Right now we may not be able to use CurveCP/NaCl because of FIPS
and possible crypto export bureaucrats. It seems only OpenSSL
is allowed.

This is a case of bureacracy getting in the way of security.
Surely other people have run into the same problem.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Fwd: 0MQ fails when it goes through a switch

2015-04-12 Thread Stephen Hemminger
On Thu, 09 Apr 2015 13:26:19 +0200
Dorvin  wrote:

> Switch receives frame and tries to forward it. But switch has some 
> queues on each port. These queues are of finite size and if you try to 
> send to much information in one frame then it might be dropped. Second 
> thing is Ethernet standard defines max ethernet payload size to be 1500 
> bytes. If you try to send more then it might not work. There are 
> extensions to this standard which allow for bigger payloads (it's called 
> jumbo frame) but you would have to check with switch documentation if 
> your device supports that and how to enable it. There are also other 
> options that might influence your traffic but embedded switches are 
> usually dumb machines with little capabilities.
> 
> 0MQ is supposed to handle large messages but I don't know why your 
> switches complain. If you have this possibility try to check your code 
> with enterprise-class switches and troubleshoot there. These switches 
> will tell you far more about what's wrong with your code

If it truly is a layer 2 switch.
Make sure the MTU setting is same on all systems connected to the switch.

Also, make sure that that switch is compatible with the frame size you choose.
Some older consumer grade switches only support 1500 byte MTU.  If you set MTU
to correct value (even 1500) then TCP will do the necessary logic to break up
the request into smaller packets and reassemble.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] profiling czmq applications

2015-04-01 Thread Stephen Hemminger
Linux perf is probably the best. There are lots of tutorials and talks on
it if you look around.

On Wed, Apr 1, 2015 at 9:42 AM, Pieter Hintjens  wrote:

> If you do find a good profiling tool, I'd be interested in knowing
> what you use. I've tried gprof and dtrace without much success.
>
> On Wed, Apr 1, 2015 at 2:05 PM, Stefan Kaes  wrote:
> > Hi,
> >
> > I’ve tried using gperftools to profile a czmq application, with no
> immediate
> > success.
> >
> > Gperftools use interval timers to record stack information and this
> seems to
> > interrupt zpollers.
> >
> > After to patching czmq to ignore errors in zloop_start(), I was able to
> > profile. But the patch is really a brute force hack.
> >
> > My questions:
> >
> > Is this a known problem and are there ways to mitigate it?
> >
> > Or are you using different profiling tools which work better than
> > gperftools?
> >
> > Regards,
> >
> > — stefan
> >
> >
> > ___
> > zeromq-dev mailing list
> > zeromq-dev@lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Can we customize a behaviour for in-mem queued messages after reconnect?

2013-12-20 Thread Stephen Hemminger
On Fri, 20 Dec 2013 16:18:52 -0500
Lindley French  wrote:

> Yes and no. In general, yes, you're absolutely right. On the other hand, if
> you don't mind opening a new TCP connection for each transaction (not
> always ideal, but not always bad; it depends), then a successful TCP close
> is equivalent to a transaction ack.
> 
> I'm starting to think a *lot* of reliability protocols built on top of TCP
> could be done more efficiently if TCP could expose some read-only
> information about its internal ACKing
> 
> 
> On Fri, Dec 20, 2013 at 4:13 PM, Stephen Hemminger <
> step...@networkplumber.org> wrote:
> 
> > On Fri, 20 Dec 2013 15:01:04 -0500
> > Lindley French  wrote:
> >
> > > The problem, in my view, is that normally you can trust TCP to get your
> > packets through intact.
> >
> > Applications only know it made it to the socket queue, not that TCP ever
> > sent it and got
> > an acknowledgment or that the remote application got the message. To do
> > reliable communication
> > you need an end-to-end acknowledgment. This doesn't have to be on a
> > per-packet basis but
> > on a per-transaction basis. Think of what SCP/FTP do for file transfer.
> >

TCP close is not a synchronization point. The OS may decide to drop
unsent, unacknowledged data there is no guranteed it got ack'd and even
less assurance that the server read it.

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Can we customize a behaviour for in-mem queued messages after reconnect?

2013-12-20 Thread Stephen Hemminger
On Fri, 20 Dec 2013 15:01:04 -0500
Lindley French  wrote:

> The problem, in my view, is that normally you can trust TCP to get your 
> packets through intact. 

Applications only know it made it to the socket queue, not that TCP ever sent 
it and got
an acknowledgment or that the remote application got the message. To do 
reliable communication
you need an end-to-end acknowledgment. This doesn't have to be on a per-packet 
basis but
on a per-transaction basis. Think of what SCP/FTP do for file transfer.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Does ZMQ handle tcp-RST?

2013-12-19 Thread Stephen Hemminger
On Thu, 19 Dec 2013 09:22:34 -0800
Michel Pelletier  wrote:

> If you and your architects believe there is a better solution to the
> problem and that 0mq is doing it wrong, then by all means, don't use it.
> Create your own solution and do it right.  I encourage you to open source
> your solution and build a community around it.  You could fork 0mq and go
> from there.
> 
> However, simplifying the statement of the problem until it "goes away" is
> not the same thing as solving it.  As many people on this thread have told
> you, the only way to know that your message got to your destination is to
> receive an acknowledgement.  We did not make this up in order to make 0mq.
> It is the nature of reality.

See also: http://en.wikipedia.org/wiki/Two_Generals'_Problem
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] zproxy (hopefully) improvements

2013-12-05 Thread Stephen Hemminger
On Thu, 5 Dec 2013 13:18:50 -0600
AJ Lewis  wrote:

> Absolutely - so if you build czmq against a newer version of zeromq, and
> then drop that czmq build into an environment with an older version of
> zeromq installed, what happens?  I think this fails spectacularly right now,
> even before any of the changes discussed below.

Isn't this what shared library ABI versioning is for.
At least on Linux, if you play by the rules it all works.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] GPL'd libs

2013-07-15 Thread Stephen Hemminger
On Mon, 15 Jul 2013 20:14:02 +0200
Diego Duclos  wrote:

> In my case (why didn't I mention this ?) my specific problem is
> txZMQ.
> Which is, very sadly, a GPL'd lib
> 

Talk to the author is always the best first choice.
This package also uses GPLv2 which has compatibility issues with GPLv3.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Using the full bandwidth of a 10 GBps link on Windows 7

2013-07-03 Thread Stephen Hemminger
Windows 7 has a bandwidth limit which is used to reserve some capacity
for real time applications. Forgot what the magic name or registry values.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] ztree for CZMQ?

2013-05-30 Thread Stephen Hemminger
For various data structures we wanted an ordered list, the czmq model seems 
great
but was missing it.

Looking at other tree code they were ugly,because C as template language which
results in macro madness. So went ahead and extracted algorithm from GPL
code for red-black tree and added API modelled after zhash.

Still debugging, but should have a ztree() submission ready by next week.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] zctx_destroy is hanging

2013-05-22 Thread Stephen Hemminger
On Wed, 22 May 2013 09:44:52 +0200
Pieter Hintjens  wrote:

> Can you provide a minimal reproducible case?
> 
> -Pieter
> 
> 
> On Wed, May 22, 2013 at 12:32 AM, Stephen Hemminger <
> step...@networkplumber.org> wrote:
> 
> > We have a ZMQ based application (in C) using CZMQ and ZMQ 2.2.0
> > When daemon is due to be restarted or shutdown
> >  1. it receives a SIGTERM
> >  2. The signal is caught, and flag is set
> >  3. all the worker threads exit
> >  4. main thread waits for workers and does some other cleanup
> >  5. calls zctx_destroy()
> > and hangs there; any clues? maybe the zctx_destroy() is redundant anyway.
> >
> >
> > int
> > main(int argc, char **argv)
> > {
> >...
> >
> > zctx_destroy(&zmq_ctx); << hang here
> >
> > return 0;
> > }
> >
> > There were several ZMQ sockets created, instrumenting CZMQ, it looks
> > like ZMQ is hanging in zctx__socket_destroy() of the ZMQ_REQ socket
> > which was bound twice, once to an ipc: endpoint and again to a
> > tcp://lo:5910
> > endpoint.
> >
> > Internally it looks like ZMQ reaper isn't working.
> >
> > The back trace of main thread is:
> > [Switching to thread 1 (Thread 0x7f1267625c80 (LWP 2065))]#0
> >  0x7f126626ec13 in poll () from /lib/libc.so.6
> > (gdb) where
> > #0  0x7f126626ec13 in poll () from /lib/libc.so.6
> > #1  0x7f1266bd5df0 in zmq::signaler_t::wait (this= > out>,
> > timeout_=-1) at signaler.cpp:145
> > #2  0x7f1266bc6aae in zmq::mailbox_t::recv (this=0x1b4c808,
> > cmd_=0x7fff010baee0, timeout_=-1) at mailbox.cpp:74
> > #3  0x7f1266bc059d in zmq::ctx_t::terminate (this=0x1b4c770) at
> > ctx.cpp:146
> > #4  0x7f1266be100c in zmq_term (ctx_=0x1b4c770) at zmq.cpp:292
> > #5  0x7f1266df8efe in zctx_destroy (self_p=0x7107a0) at zctx.c:122
> > #6  0x0040ae53 in main (argc=,
> >
> > Some other threads:
> > (gdb) thread 4
> > [Switching to thread 4 (Thread 0x7f1241bf9700 (LWP 2149))]#0
> >  0x7f126627a163 in epoll_wait () from /lib/libc.so.6
> > (gdb) where
> > #0  0x7f126627a163 in epoll_wait () from /lib/libc.so.6
> > #1  0x7f1266bc3a90 in zmq::epoll_t::loop (this=0x1b4e680) at
> > epoll.cpp:142
> > #2  0x7f1266bdbdeb in thread_routine (arg_=0x1b4e6f0) at thread.cpp:75
> > #3  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> > #4  0x7f1266279b6d in clone () from /lib/libc.so.6
> > #5  0x in ?? ()
> > (gdb) thread 5
> > [Switching to thread 5 (Thread 0x7f12423fa700 (LWP 2148))]#0
> >  0x7f126627a163 in epoll_wait () from /lib/libc.so.6
> > (gdb) where
> > #0  0x7f126627a163 in epoll_wait () from /lib/libc.so.6
> > #1  0x7f1266bc3a90 in zmq::epoll_t::loop (this=0x1b4d050) at
> > epoll.cpp:142
> > #2  0x7f1266bdbdeb in thread_routine (arg_=0x1b4d0c0) at thread.cpp:75
> > #3  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> > #4  0x7f1266279b6d in clone () from /lib/libc.so.6
> > #5  0x in ?? ()
> > (gdb) thread 6
> > [Switching to thread 6 (Thread 0x7f1242bfb700 (LWP 2102))]#0
> >  0x7f126651a14d in read () from /lib/libpthread.so.0
> > (gdb) where
> > #0  0x7f126651a14d in read () from /lib/libpthread.so.0
> > #1  0x004c6938 in eal_thread_loop ()
> > #2  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> > #3  0x7f1266279b6d in clone () from /lib/libc.so.6
> > #4  0x in ?? ()
> > (gdb) thread 7
> > [Switching to thread 7 (Thread 0x7f12433fc700 (LWP 2101))]#0
> >  0x7f126651a14d in read () from /lib/libpthread.so.0
> > (gdb) where
> > #0  0x7f126651a14d in read () from /lib/libpthread.so.0
> > #1  0x004c6938 in eal_thread_loop ()
> > #2  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> > #3  0x7f1266279b6d in clone () from /lib/libc.so.6
> > #4  0x in ?? ()
> > (gdb) thread 8
> > [Switching to thread 8 (Thread 0x7f1243bfd700 (LWP 2100))]#0
> >  0x7f126651a14d in read () from /lib/libpthread.so.0
> > (gdb) where
> > #0  0x7f126651a14d in read () from /lib/libpthread.so.0
> > #1  0x004c6938 in eal_thread_loop ()
> > #2  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> > #3  0x7f1266279b6d in clone () from /lib/libc.so.6
> > #4  0x in ?? ()
> > ___
> > zeromq-dev mailing list
> > zeromq-dev@lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >

Found it, not a zmq problem per say.
Like any other application, our application has grown, and off in a new feature
there is another zthread which was being started as a detached thread but using
the same ctx and not exiting. Having it watch the same exit flag, and giving it
it's own context solved the issue.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] zctx_destroy is hanging

2013-05-21 Thread Stephen Hemminger
czmq already does this by default.

On Tue, May 21, 2013 at 10:27 PM, Stathis Gkotsis
 wrote:
> Hi,
>
> Try setting linger to 0 just before.
>
> Kind regards,
> Stathis
>
> - Original Message -
> From: Stephen Hemminger [mailto:step...@networkplumber.org]
> Sent: Wednesday, May 22, 2013 12:32 AM
> To: zeromq-dev@lists.zeromq.org 
> Subject: [zeromq-dev] zctx_destroy is hanging
>
> We have a ZMQ based application (in C) using CZMQ and ZMQ 2.2.0
> When daemon is due to be restarted or shutdown
>  1. it receives a SIGTERM
>  2. The signal is caught, and flag is set
>  3. all the worker threads exit
>  4. main thread waits for workers and does some other cleanup
>  5. calls zctx_destroy()
> and hangs there; any clues? maybe the zctx_destroy() is redundant anyway.
>
>
> int
> main(int argc, char **argv)
> {
>...
>
> zctx_destroy(&zmq_ctx); << hang here
>
> return 0;
> }
>
> There were several ZMQ sockets created, instrumenting CZMQ, it looks
> like ZMQ is hanging in zctx__socket_destroy() of the ZMQ_REQ socket
> which was bound twice, once to an ipc: endpoint and again to a tcp://lo:5910
> endpoint.
>
> Internally it looks like ZMQ reaper isn't working.
>
> The back trace of main thread is:
> [Switching to thread 1 (Thread 0x7f1267625c80 (LWP 2065))]#0  
> 0x7f126626ec13 in poll () from /lib/libc.so.6
> (gdb) where
> #0  0x7f126626ec13 in poll () from /lib/libc.so.6
> #1  0x7f1266bd5df0 in zmq::signaler_t::wait (this=,
> timeout_=-1) at signaler.cpp:145
> #2  0x7f1266bc6aae in zmq::mailbox_t::recv (this=0x1b4c808,
> cmd_=0x7fff010baee0, timeout_=-1) at mailbox.cpp:74
> #3  0x7f1266bc059d in zmq::ctx_t::terminate (this=0x1b4c770) at 
> ctx.cpp:146
> #4  0x7f1266be100c in zmq_term (ctx_=0x1b4c770) at zmq.cpp:292
> #5  0x7f1266df8efe in zctx_destroy (self_p=0x7107a0) at zctx.c:122
> #6  0x0040ae53 in main (argc=,
>
> Some other threads:
> (gdb) thread 4
> [Switching to thread 4 (Thread 0x7f1241bf9700 (LWP 2149))]#0  
> 0x7f126627a163 in epoll_wait () from /lib/libc.so.6
> (gdb) where
> #0  0x7f126627a163 in epoll_wait () from /lib/libc.so.6
> #1  0x7f1266bc3a90 in zmq::epoll_t::loop (this=0x1b4e680) at epoll.cpp:142
> #2  0x7f1266bdbdeb in thread_routine (arg_=0x1b4e6f0) at thread.cpp:75
> #3  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> #4  0x7f1266279b6d in clone () from /lib/libc.so.6
> #5  0x in ?? ()
> (gdb) thread 5
> [Switching to thread 5 (Thread 0x7f12423fa700 (LWP 2148))]#0  
> 0x7f126627a163 in epoll_wait () from /lib/libc.so.6
> (gdb) where
> #0  0x7f126627a163 in epoll_wait () from /lib/libc.so.6
> #1  0x7f1266bc3a90 in zmq::epoll_t::loop (this=0x1b4d050) at epoll.cpp:142
> #2  0x7f1266bdbdeb in thread_routine (arg_=0x1b4d0c0) at thread.cpp:75
> #3  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> #4  0x7f1266279b6d in clone () from /lib/libc.so.6
> #5  0x in ?? ()
> (gdb) thread 6
> [Switching to thread 6 (Thread 0x7f1242bfb700 (LWP 2102))]#0  
> 0x7f126651a14d in read () from /lib/libpthread.so.0
> (gdb) where
> #0  0x7f126651a14d in read () from /lib/libpthread.so.0
> #1  0x004c6938 in eal_thread_loop ()
> #2  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> #3  0x7f1266279b6d in clone () from /lib/libc.so.6
> #4  0x in ?? ()
> (gdb) thread 7
> [Switching to thread 7 (Thread 0x7f12433fc700 (LWP 2101))]#0  
> 0x7f126651a14d in read () from /lib/libpthread.so.0
> (gdb) where
> #0  0x7f126651a14d in read () from /lib/libpthread.so.0
> #1  0x004c6938 in eal_thread_loop ()
> #2  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> #3  0x7f1266279b6d in clone () from /lib/libc.so.6
> #4  0x in ?? ()
> (gdb) thread 8
> [Switching to thread 8 (Thread 0x7f1243bfd700 (LWP 2100))]#0  
> 0x7f126651a14d in read () from /lib/libpthread.so.0
> (gdb) where
> #0  0x7f126651a14d in read () from /lib/libpthread.so.0
> #1  0x004c6938 in eal_thread_loop ()
> #2  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
> #3  0x7f1266279b6d in clone () from /lib/libc.so.6
> #4  0x in ?? ()
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] zctx_destroy is hanging

2013-05-21 Thread Stephen Hemminger
We have a ZMQ based application (in C) using CZMQ and ZMQ 2.2.0
When daemon is due to be restarted or shutdown
 1. it receives a SIGTERM
 2. The signal is caught, and flag is set
 3. all the worker threads exit
 4. main thread waits for workers and does some other cleanup
 5. calls zctx_destroy()
and hangs there; any clues? maybe the zctx_destroy() is redundant anyway.


int
main(int argc, char **argv)
{
   ...
   
zctx_destroy(&zmq_ctx); << hang here

return 0;
}

There were several ZMQ sockets created, instrumenting CZMQ, it looks
like ZMQ is hanging in zctx__socket_destroy() of the ZMQ_REQ socket
which was bound twice, once to an ipc: endpoint and again to a tcp://lo:5910
endpoint.

Internally it looks like ZMQ reaper isn't working.

The back trace of main thread is:
[Switching to thread 1 (Thread 0x7f1267625c80 (LWP 2065))]#0  
0x7f126626ec13 in poll () from /lib/libc.so.6
(gdb) where
#0  0x7f126626ec13 in poll () from /lib/libc.so.6
#1  0x7f1266bd5df0 in zmq::signaler_t::wait (this=, 
timeout_=-1) at signaler.cpp:145
#2  0x7f1266bc6aae in zmq::mailbox_t::recv (this=0x1b4c808, 
cmd_=0x7fff010baee0, timeout_=-1) at mailbox.cpp:74
#3  0x7f1266bc059d in zmq::ctx_t::terminate (this=0x1b4c770) at ctx.cpp:146
#4  0x7f1266be100c in zmq_term (ctx_=0x1b4c770) at zmq.cpp:292
#5  0x7f1266df8efe in zctx_destroy (self_p=0x7107a0) at zctx.c:122
#6  0x0040ae53 in main (argc=,

Some other threads:
(gdb) thread 4
[Switching to thread 4 (Thread 0x7f1241bf9700 (LWP 2149))]#0  
0x7f126627a163 in epoll_wait () from /lib/libc.so.6
(gdb) where
#0  0x7f126627a163 in epoll_wait () from /lib/libc.so.6
#1  0x7f1266bc3a90 in zmq::epoll_t::loop (this=0x1b4e680) at epoll.cpp:142
#2  0x7f1266bdbdeb in thread_routine (arg_=0x1b4e6f0) at thread.cpp:75
#3  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
#4  0x7f1266279b6d in clone () from /lib/libc.so.6
#5  0x in ?? ()
(gdb) thread 5
[Switching to thread 5 (Thread 0x7f12423fa700 (LWP 2148))]#0  
0x7f126627a163 in epoll_wait () from /lib/libc.so.6
(gdb) where
#0  0x7f126627a163 in epoll_wait () from /lib/libc.so.6
#1  0x7f1266bc3a90 in zmq::epoll_t::loop (this=0x1b4d050) at epoll.cpp:142
#2  0x7f1266bdbdeb in thread_routine (arg_=0x1b4d0c0) at thread.cpp:75
#3  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
#4  0x7f1266279b6d in clone () from /lib/libc.so.6
#5  0x in ?? ()
(gdb) thread 6
[Switching to thread 6 (Thread 0x7f1242bfb700 (LWP 2102))]#0  
0x7f126651a14d in read () from /lib/libpthread.so.0
(gdb) where
#0  0x7f126651a14d in read () from /lib/libpthread.so.0
#1  0x004c6938 in eal_thread_loop ()
#2  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
#3  0x7f1266279b6d in clone () from /lib/libc.so.6
#4  0x in ?? ()
(gdb) thread 7
[Switching to thread 7 (Thread 0x7f12433fc700 (LWP 2101))]#0  
0x7f126651a14d in read () from /lib/libpthread.so.0
(gdb) where
#0  0x7f126651a14d in read () from /lib/libpthread.so.0
#1  0x004c6938 in eal_thread_loop ()
#2  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
#3  0x7f1266279b6d in clone () from /lib/libc.so.6
#4  0x in ?? ()
(gdb) thread 8
[Switching to thread 8 (Thread 0x7f1243bfd700 (LWP 2100))]#0  
0x7f126651a14d in read () from /lib/libpthread.so.0
(gdb) where
#0  0x7f126651a14d in read () from /lib/libpthread.so.0
#1  0x004c6938 in eal_thread_loop ()
#2  0x7f12665128ca in start_thread () from /lib/libpthread.so.0
#3  0x7f1266279b6d in clone () from /lib/libc.so.6
#4  0x in ?? ()
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] debian zeromq links update

2013-05-20 Thread Stephen Hemminger
Several links about Debian packages on
 http://www.zeromq.org/distro:debian
are out of date.

1. There is libzmq for squeeze-backports
 http://packages.debian.org/squeeze-backports/libzmq1

2. You should add jessie release now as well
  http://packages.debian.org/source/jessie/zeromq

3. The link to experimental for 3.2 is dead. I think the correct link is:
  http://packages.debian.org/sid/libzmq3

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] client not reconnecting properly or syn-fin death spiral

2012-10-25 Thread Stephen Hemminger
On Fri, 26 Oct 2012 10:05:29 +0900
Pieter Hintjens  wrote:

> On Fri, Oct 26, 2012 at 9:33 AM, Stephen Hemminger
>  wrote:
> 
> > The problem was related to setting identity on the DEALER.
> > Turns out than when the DEALER reconnects the internal ROUTER
> > code thinks the new socket is a duplicate of the old (still timing out)
> > socket and closes it.
> 
> Ah, right. If the client didn't close the socket properly, TCP won't
> report the error for a while.
> 
> Do you see anything we can do in the router socket to make this work
> better? Allowing duplicate identities won't work, and allowing a
> second client to "grab" the identity of an existing one won't work
> either.
> 
> Perhaps we need ping-pong heartbeating in the socket layer.
> 
> -Pieter

For our application, since client has unique IP address, and it is needed
in initial setup, just sending that works instead of setting identity.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] client not reconnecting properly or syn-fin death spiral

2012-10-25 Thread Stephen Hemminger
On Thu, 18 Oct 2012 12:11:06 +0900
Pieter Hintjens  wrote:

> On Thu, Oct 18, 2012 at 11:39 AM, Pieter Hintjens  wrote:
> 
> > Probably irrelevant, but setting identity on SUB and DEALER sockets is
> > meaningless.
> 
> Sorry, this was wrong... it's legal on DEALER but not on SUB.
> 
> -Pieter

The problem was related to setting identity on the DEALER.
Turns out than when the DEALER reconnects the internal ROUTER
code thinks the new socket is a duplicate of the old (still timing out)
socket and closes it.

Trace looks like:

DEALER   ->   ROUTER
   Syn ->
   <- Syn/Ack
   Ack ->

   Request -> [ID, data]
   <-ACK
   <- Response

 DEALER crashes ===
   Syn ->
   <- Syn/Ack
   Ack ->

   Request -> [ID, data]
   <- Ack
   <- Fin
   Fin,Ack ->

The application was (mis)using IDENTITY as a form of session ID.
When client restarts it needs to be a new session.

This also explains why it would eventually clear out.
The ROUTER (server) would eventually do keepalive and detect dead old
socket.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] client not reconnecting properly or syn-fin death spiral

2012-10-17 Thread Stephen Hemminger
I am decomposing it into smaller pieces. A couple of suspects is that could be 
related to overlaping timeouts in the client from manual polling, zmq and TCP. 
Could also be related to running in a VM where there is little random entropy 
on boot?
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] client not reconnecting properly or syn-fin death spiral

2012-10-17 Thread Stephen Hemminger
In our application which looks a little like the clonvsrv2 pattern
in the guide. 
If client is rebooted, it gets stuck and never reconnects.

This all using Zmq packages in Debian squeeze-backports (ie 2.2.0+dfsg-2)

Server:
 pub= zocket_new(ctx, ZMQ_PUB);
 zsockopt_set_hwm(pub, 8192);
 zsocket_bind(pub, server_pub_endpoint);

 req = zsocket_new(ctx, ZMQ_ROUTER);
 zsocket_bind(req, server_sync_endpoint);


Client:
 s1 = zsocket_new(ctx, ZMQ_SUB);
 zsocket_set_identity(s1, configured_uuid);
 zsocket_connect(s1, server_pub_endpoint);
 
 s2 = zsocket_new(ctx, ZMQ_DEALER);
 zsocket_set_identity(s2, configure_uuid);
 zsocket_connect(s2, server_sync_endpoint);

After a brief period 173 TCP sockets stuck in TIME-WAIT on the server
and still no connection. It looks like the client is trying to make new
connection for synchronization and the TCP tuple on the server is still in use
or being rejected.

Is ZMQ trying to choose its own ephemeral ports? There appears to be no port
randomization?

Eventually, all the TIME-WAIT sockets clear and the client finds a comfortable
connection.

Each handshake looks like:
8:47:37.782009 IP 192.168.1.31.49339 > 192.168.1.41.5904: Flags [S], seq 
4021932813, win 14600, options [mss 1460,sackOK,TS val 113438 ecr 0,nop,wscale 
7], length 0
18:47:37.782280 IP 192.168.1.41.5904 > 192.168.1.31.49339: Flags [S.], seq 
269340484, ack 4021932814, win 14480, options [mss 1460,sackOK,TS val 166082 
ecr 113438,nop,wscale 7], length 0
18:47:37.783683 IP 192.168.1.31.49339 > 192.168.1.41.5904: Flags [.], ack 1, 
win 115, options [nop,nop,TS val 113438 ecr 166082], length 0
18:47:37.783695 IP 192.168.1.31.49339 > 192.168.1.41.5904: Flags [P.], seq 
1:39, ack 1, win 115, options [nop,nop,TS val 113438 ecr 166082], length 38
18:47:37.783906 IP 192.168.1.41.5904 > 192.168.1.31.49339: Flags [.], ack 39, 
win 114, options [nop,nop,TS val 166083 ecr 113438], length 0
18:47:37.784068 IP 192.168.1.41.5904 > 192.168.1.31.49339: Flags [F.], seq 1, 
ack 39, win 114, options [nop,nop,TS val 166083 ecr 113438], length 0
18:47:37.784314 IP 192.168.1.31.49339 > 192.168.1.41.5904: Flags [F.], seq 39, 
ack 2, win 115, options [nop,nop,TS val 113438 ecr 166083], length 0
18:47:37.784539 IP 192.168.1.41.5904 > 192.168.1.31.49339: Flags [.], ack 40, 
win 114, options [nop,nop,TS val 166083 ecr 113438], length 0
18:47:37.931600 IP 192.168.1.31.49340 > 192.168.1.41.5904: Flags [S], seq 
2846485645, win 14600, options [mss 1460,sackOK,TS val 113452 ecr 0,nop,wscale 
7], length 0
18:47:37.931933 IP 192.168.1.41.5904 > 192.168.1.31.49340: Flags [S.], seq 
875941597, ack 2846485646, win 14480, options [mss 1460,sackOK,TS val 166097 
ecr 113452,nop,wscale 7], length 0
18:47:37.932205 IP 192.168.1.31.49340 > 192.168.1.41.5904: Flags [.], ack 1, 
win 115, options [nop,nop,TS val 113453 ecr 166097], length 0
18:47:37.932226 IP 192.168.1.31.49340 > 192.168.1.41.5904: Flags [P.], seq 
1:39, ack 1, win 115, options [nop,nop,TS val 113453 ecr 166097], length 38
18:47:37.932462 IP 192.168.1.41.5904 > 192.168.1.31.49340: Flags [.], ack 39, 
win 114, options [nop,nop,TS val 166097 ecr 113453], length 0
18:47:37.932686 IP 192.168.1.41.5904 > 192.168.1.31.49340: Flags [F.], seq 1, 
ack 39, win 114, options [nop,nop,TS val 166098 ecr 113453], length 0
18:47:37.932945 IP 192.168.1.31.49340 > 192.168.1.41.5904: Flags [F.], seq 39, 
ack 2, win 115, options [nop,nop,TS val 113453 ecr 166098], length 0
18:47:37.933184 IP 192.168.1.41.5904 > 192.168.1.31.49340: Flags [.], ack 40, 
win 114, options [nop,nop,TS val 166098 ecr 113453], length 0
18:47:38.080230 IP 192.168.1.31.49341 > 192.168.1.41.5904: Flags [S], seq 
3167428905, win 14600, options [mss 1460,sackOK,TS val 113467 ecr 0,nop,wscale 
7], length 0
18:47:38.080465 IP 192.168.1.41.5904 > 192.168.1.31.49341: Flags [S.], seq 
2712872645, ack 3167428906, win 14480, options [mss 1460,sackOK,TS val 166112 
ecr 113467,nop,wscale 7], length 0
18:47:38.080724 IP 192.168.1.31.49341 > 192.168.1.41.5904: Flags [.], ack 1, 
win 115, options [nop,nop,TS val 113467 ecr 166112], length 0
18:47:38.080754 IP 192.168.1.31.49341 > 192.168.1.41.5904: Flags [P.], seq 
1:39, ack 1, win 115, options [nop,nop,TS val 113467 ecr 166112], length 38
18:47:38.080973 IP 192.168.1.41.5904 > 192.168.1.31.49341: Flags [.], ack 39, 
win 114, options [nop,nop,TS val 166112 ecr 113467], length 0
18:47:38.081227 IP 192.168.1.41.5904 > 192.168.1.31.49341: Flags [F.], seq 1, 
ack 39, win 114, options [nop,nop,TS val 166112 ecr 113467], length 0
18:47:38.081484 IP 192.168.1.31.49341 > 192.168.1.41.5904: Flags [F.], seq 39, 
ack 2, win 115, options [nop,nop,TS val 113467 ecr 166112], length 0
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Regression in czmq (latest)

2012-09-26 Thread Stephen Hemminger
On Wed, 26 Sep 2012 07:03:39 -0500
Pieter Hintjens  wrote:

> On Tue, Sep 25, 2012 at 6:42 PM, Stephen Hemminger
>  wrote:
> 
> > Noticed build failures after merge, because build script does check test.
> 
> Mea culpa, was trying to add a small optimization on zlist_remove but
> did it wrong.
> 
> I've made a pull request that removes my change, it works again.
> 
> -Pieter

Thanks, that fixed it.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] Regression in czmq (latest)

2012-09-25 Thread Stephen Hemminger
Noticed build failures after merge, because build script does check test.

Bisected it down to:
$ make -j1 check
Making check in src
make[1]: Entering directory `/usr/src/zeromq/czmq/src'
make  check-TESTS
make[2]: Entering directory `/usr/src/zeromq/czmq/src'
Running czmq self tests...
 * zclock: OK
 * zctx: OK
 * zfile: OK
 * zframe: OK
 * zhash: OK
lt-czmq_selftest: zlist.c:405: zlist_test: Assertion `zlist_last (list) == 
cheese' failed.
 * zlist: /bin/bash: line 5: 19608 Aborted ${dir}$tst
FAIL: czmq_selftest

1 of 1 test failed
Please report to zeromq-dev@lists.zeromq.org

make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `/usr/src/zeromq/czmq/src'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/usr/src/zeromq/czmq/src'
make: *** [check-recursive] Error 1

$ git bisect bad
f5b8dad1a26d0405d6c30960b82d94aa2500b2cc is the first bad commit
commit f5b8dad1a26d0405d6c30960b82d94aa2500b2cc
Author: Pieter Hintjens 
Date:   Sat Sep 22 10:54:11 2012 +0200

Optimization for zlist_remove last seen item

:04 04 525da044b721454a494c0f6b80c6c0cef7d18adc 
fd0c04f0926481cce77f3a6fa195f54326239c1c M  src
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] Please add git tag to release versions of CZMQ

2012-09-04 Thread Stephen Hemminger
It looks like a git tag was never added to the git repository when
CZMQ 1.2 was released.  It helps our tracking and process if the git tag is 
used.

Thanks.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] How to safely use a socket in multiple threads in zmq 2.1.11

2012-07-04 Thread Stephen Hemminger
On Wed, 4 Jul 2012 19:24:21 -0300
Thiago Cangussu  wrote:

> Hi,
> 
> I have a pool of threads that needs to send messages to a zmq socket. I was
> creating the socket, connecting, sending the message and closing it for
> each message, but it is for sure not an optimal usage of resources, since
> if I create/close sockets too fast, zmq is not able do release them as fast
> and I get the error: "too many open files (signaler.cpp 330)". Since I have
> no control over those threads, I'm about to try the following solution:
> 
> 1 - create a pool of connected sockets (REQ, inproc)
> 2 - when a client thread wants to send a message, it grabs a socket from
> the pool
> 3 - the thread performs a send/recv
> 4 - the thread releases the socket (which will be again available in the
> pool)
> 
> The question is: what should I do to make this multi-threaded usage of
> sockets safe? Is it enough to guarantee that multiple threads do not
> perform send/receive simultaneously?
> 
> Thanks,
> Thiago

You can have a per-thread pool of sockets, but you can't create socket
in one thread and then use it in another. Can you just have one socket
per thread in thread local storage?
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Building czmq without first installing zeromq

2012-06-21 Thread Stephen Hemminger
On Fri, 22 Jun 2012 00:22:49 +
Cedric Krumbein  wrote:

> Am I to assume from that, that building czmq without first installing zeromq 
> isn't supported?
> 
> Cedric
> 
> -Original Message-
> From: Stephen Hemminger [mailto:shemmin...@vyatta.com] 
> Sent: Thursday, June 21, 2012 5:21 PM
> To: ZeroMQ development list
> Cc: Cedric Krumbein
> Subject: Re: [zeromq-dev] Building czmq without first installing zeromq
> 
> On Fri, 22 Jun 2012 00:08:21 +
> Cedric Krumbein  wrote:
> 
> > I'm new to zeromq.  I'm currently trying build both zeromq-2.2.0 and 
> > czmq-1.1.0.  I'm not allowed to install either one.  I've successfully 
> > built zeromq, but I'm not able to build czmq.  When I run czmq's configure 
> > script, it says "cannot link with -lzmq, install libzmq".  I've tried 
> > various combinations of -with-libzmq and LD_LIBRARY_PATH, all without 
> > success.  Can someone advise me on how to build czmq without installing 
> > zeromq?
> > 
> > Thanks in advance,
> > Cedric
> 
> Get a real IT department, or better yet build in a VM where you can install 
> what you want.

Honestly, never tried it, just been lucky not to deal with the issue.
If you set the right library paths, it should work. There cases where it is
necessary (cross compiling). Depending on the platform.
Not sure what all the magic configure options are to do it.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Building czmq without first installing zeromq

2012-06-21 Thread Stephen Hemminger
On Fri, 22 Jun 2012 00:08:21 +
Cedric Krumbein  wrote:

> I'm new to zeromq.  I'm currently trying build both zeromq-2.2.0 and 
> czmq-1.1.0.  I'm not allowed to install either one.  I've successfully built 
> zeromq, but I'm not able to build czmq.  When I run czmq's configure script, 
> it says "cannot link with -lzmq, install libzmq".  I've tried various 
> combinations of -with-libzmq and LD_LIBRARY_PATH, all without success.  Can 
> someone advise me on how to build czmq without installing zeromq?
> 
> Thanks in advance,
> Cedric

Get a real IT department, or better yet build in a VM where you can install 
what you want.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] zeromq licensing forbidden at my company

2012-04-23 Thread Stephen Hemminger
On Mon, 23 Apr 2012 13:13:54 -0400
Aaron Watters  wrote:

> FYI the company permits LGPL less than 3 but not 3.  I don't know why.  --
> Aaron Watters

Almost certainly caused by the enhanced patent protection of GPLv3.

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] data collector pattern

2012-03-20 Thread Stephen Hemminger
The guide is full of wonderful and useful cases, but there is one that appears
to be missing. For some applications there are lots of clients generating and 
one collector.
The clients typically generate data like statistics or information (like a 
temperature sensor)
that occurs periodically.  Each message from the client is idempotent and 
supersedes
the last one, therefore it is acceptable for the collector to miss one. This is 
sort of
the inverse of PUB-SUB.

What is the best way to do this kind of lossy data collection and still scale. 
The slow
way would be to use request/reply. Another awkward method would be to have the 
collector
subscribe to all the clients, but that requires an out of band protocol to find 
the client
endpoints. Pgn also works but requires that PGM protocol work in the network.

Maybe some combination of ROUTER-DEALER?
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] Proposal for next stable release

2012-03-16 Thread Stephen Hemminger
There seems to be a high interest in having a stable version of zeromq.
The maintainers have done a good job of getting versions like 2.1 out in the
past, but the transition in development model has made some users uneasy.

I would like to propose a new model for stable release 
based on the successful model of the Linux kernel stable
tree maintained by Greg Kroah Hartmann. I am new at zeromq but would
be willing to get this started as maintainer.  But understand this is a
process which means any patch that follows the rules gets accepted, I am
not going to micro-manage the patches, if it meets the criteria it will get
in. The review has to come from the community.

(Proposed) rules based on edit of Linux rules.

Rules on what kind of patches are accepted, and which ones are not, into the
"-stable" branch:

 - It must be obviously correct and tested.
 - It cannot be bigger than 100 lines, with context.
 - It must fix only one thing.
 - It must fix a real bug that bothers people (not a, "This could be a
   problem..." type thing).
 - It must fix a problem that causes a build error, a crash, a hang, 
   data corruption, a real security issue, or some "oh, that's not good"
   issue. In short, something critical.
 - No API, ABI, or protocol incompatibility.
 - No "theoretical race condition" issues, unless an explanation of how the
   race can be exploited is also provided.
 - It cannot contain any "trivial" fixes in it (spelling changes,
   whitespace cleanups, etc).
 - It must follow the coding style.
 - It or an equivalent fix must already exist in zeromq repository (upstream).

Procedure for submitting patches to the -stable branch:

 - Send the patch, after verifying that it follows the above rules, to
   zeromq-sta...@lists.zeromq.org. You must note the upstream commit ID in the
   changelog of your submission, as well as the version you wish
   it to be applied to.
 - To have the patch automatically included in the stable branch, send a
   pull request to zeromq-stable.
 - Please note if the patch requires other patches as prerequisites which 
   must be cherry-picked first.
 - The sender will receive an ACK when the patch has been accepted into the
   queue, or a NAK if the patch is rejected. This response might take a few
   days, according to the developer's schedules.
 - If accepted, the patch will be added to the -stable queue, for review by
   other developers and by the relevant subsystem maintainer.

Review cycle:

 - When the -stable maintainers decide for a review cycle, the patches will be
   sent to the review committee, and CC: to zeromq-dev@lists.zeromq.org list.
 - The review committee has 48 hours in which to ACK or NAK the patch.
 - If the patch is rejected by a member of the committee, or zeromq-dev
   members object to the patch, bringing up issues that the maintainers and
   members did not realize, the patch will be dropped from the queue.
 - At the end of the review cycle, the ACKed patches will be added to the
   latest -stable release, and a new -stable release will happen.
 - Security patches will be accepted into the -stable branch directly
   and may bypass the review process (for CVE reasons).

Review committee:

 - This is made up of a number of zeromq developers who have volunteered for
   this task, and a few that haven't.

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Does the zeromq support the spin_lock internally?

2012-03-14 Thread Stephen Hemminger
On Wed, 14 Mar 2012 19:52:59 -0400
Steven McCoy  wrote:

> On 14 March 2012 17:18, Stephen Hemminger  wrote:
> 
> >
> > At least on linux there is is pthread_spin_lock()
> >
> 
> Linux = pthread_spin_lock()
> OS X = OSSpinLock()
> Win32 = Win32 atomics DIY
> GCC = GCC atomics DIY
> *BSD, Solaris = BSD atomics DIY
> 
> Alternative for systems with unaligned support = ticket based spin locks,
> fastest implementation to date.
> 
> You can find all these in OpenPGM, I looked around a bit.  Also have RW
> spinlocks.  Note some implementations are not hyper-thread safe or SMP
> aware.  I went a bit extreme and detect available cores at runtime so that
> I also support thread affinity - lock the process to one core and the
> spinlocks wont burn time.
> 
> http://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/include/impl/thread.h
> 
> http://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/thread.c
> http://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/include/impl/ticket.h
> 
> 

Of course the best code uses no locks.
Shameless plug for userspace RCU. http://lttng.org/urcu
The recent lock-less hash list is really great.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] [RFC] czmq: check printf format options

2012-03-14 Thread Stephen Hemminger
On Wed, 14 Mar 2012 18:04:02 -0500
Pieter Hintjens  wrote:

> On Wed, Mar 14, 2012 at 5:46 PM, Stephen Hemminger
>  wrote:
> 
> > git hub seems to make this more painful than it ought to.
> 
> The first time it's a little painful: you fork the repo and then push
> the change to your repo and then use the UI to create a pull request.
> 
> But even I can do it, which means it's not hard.

It would be a good process to document in the development
section of the web site.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] [RFC] czmq: check printf format options

2012-03-14 Thread Stephen Hemminger
On Wed, 14 Mar 2012 17:32:41 -0500
Pieter Hintjens  wrote:

> Oh my, that is ugly. Is there no way to make this prettier?
> 
> Anyhow, looks like a good patch, why not send a pull request.
> 
> -Pieter

git hub seems to make this more painful than it ought to.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] [RFC] czmq: check printf format options

2012-03-14 Thread Stephen Hemminger
Add checking of zmsg and zsocket arguments that take printf formats

Gcc has support for attributes that trap errors in format strings at
compile time. Not highly esthetic but it works.


diff --git a/include/zmsg.h b/include/zmsg.h
index bf866ff..d0d6fcd 100644
--- a/include/zmsg.h
+++ b/include/zmsg.h
@@ -27,6 +27,15 @@
 #ifndef __ZMSG_H_INCLUDED__
 #define __ZMSG_H_INCLUDED__
 
+// If using GCC this causes checking of syntax of format strings
+#ifndef GCC_PRINTFLIKE
+#ifdef __GNUC__
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -84,12 +93,14 @@ int
 //  Push string as new frame to front of message.
 //  Returns 0 on success, -1 on error.
 int
-zmsg_pushstr (zmsg_t *self, const char *format, ...);
+zmsg_pushstr (zmsg_t *self, const char *format, ...)
+   GCC_PRINTFLIKE(2,3);
 
 //  Push string as new frame to end of message.
 //  Returns 0 on success, -1 on error.
 int
-zmsg_addstr (zmsg_t *self, const char *format, ...);
+zmsg_addstr (zmsg_t *self, const char *format, ...)
+   GCC_PRINTFLIKE(2,3);
 
 //  Pop frame off front of message, return as fresh string
 char *
diff --git a/include/zsocket.h b/include/zsocket.h
index 8e7b993..7737888 100644
--- a/include/zsocket.h
+++ b/include/zsocket.h
@@ -27,10 +27,20 @@
 #ifndef __ZSOCKET_H_INCLUDED__
 #define __ZSOCKET_H_INCLUDED__
 
+/* Macro for usage of GCC's printf compilation warnings */
+#ifndef GCC_PRINTFLIKE
+#ifdef __GNUC__
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+
 //  @interface
 //  This port range is defined by IANA for dynamic or private ports
 //  We use this when choosing a port for dynamic binding.
@@ -54,12 +64,14 @@ void
 //  bind succeeded with the specified port number. Always returns the
 //  port number if successful.
 int
-zsocket_bind (void *socket, const char *format, ...);
+zsocket_bind (void *socket, const char *format, ...)
+   GCC_PRINTFLIKE(2,3);
 
 //  Connect a socket to a formatted endpoint
 //  Returns 0 if OK, -1 if the endpoint was invalid.
 int
-zsocket_connect (void *socket, const char *format, ...);
+zsocket_connect (void *socket, const char *format, ...)
+   GCC_PRINTFLIKE(2,3);
 
 //  Returns socket type as printable constant string
 char *
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Does the zeromq support the spin_lock internally?

2012-03-14 Thread Stephen Hemminger
On Wed, 14 Mar 2012 11:53:48 -0700
"Richard Zhang"  wrote:

> Hi there,
> 
>  
> 
> When I took a look at the source codes, it shows the ctx_t class
> implementation uses the pthread mutex locking mechanism.  In general, it
> works fine in many applications.   For the SMP architecture, the system runs
> the multicore and each worker thread can acquire the CPU to run for the
> completeness at the same time.  If use the Zeromq for the "inproc"
> communication, the inter-thread transport doesn't need the I/O thread, and
> all messages are in the memory.   It's nice to have the spin_lock
> implemented inside the Zeromq, instead of pthread mutex for this situation.
> It can reduce the context switch to cause the performance penality.  Do you
> have any idea to work around or plan to support it?  Thanks.

At least on linux there is is pthread_spin_lock()
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] pull-request libczmq

2012-03-12 Thread Stephen Hemminger
The following changes since commit 3bbf88fafdc332aad650210e103910aadf53d918:

  Merge pull request #17 from mkoppanen/master (2012-03-05 00:57:01 -0800)

are available in the git repository at:


  git://github.com/shemminger/libczmq-changes.git master

for you to fetch changes up to 83b1c00b60ecbd94f76b42433c18b20dd8e41ad8:

  Don't need math library (2012-03-12 12:02:35 -0700)


Stephen Hemminger (1):
  Don't need math library

 c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/c b/c
index ee5bd3c..fa8648b 100755
--- a/c
+++ b/c
@@ -163,7 +163,7 @@ if [ "$CCNAME" = "gcc" ]; then
 #  If your build is failing because of missing libraries then
 #  either you are missing development packages, or are on a 
non-standard/old
 #  system and should add a special case.
-STDLIBS="-lpthread -lm"
+STDLIBS="-lpthread"
 
 #
 #  Linux-specific subsection
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] czmq and math library

2012-03-12 Thread Stephen Hemminger
libczmq is linked against math library but does not appear to use it
(at least on Linux).  Not sure about other platforms:

Debian build warning:
   dh_shlibdeps
dpkg-shlibdeps: warning: dependency on libm.so.6 could be avoided if 
"debian/libczmq0/usr/lib/libczmq.so.1.0.0" were not uselessly linked against it 
(they use none of its symbols).
   dh_installdeb
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] [PATCH] fix build of zguide C examples on LInux

2012-02-28 Thread Stephen Hemminger
On Linux libuuid is a separate library.
Examples won't build unless -luuid is added.
You made to go for full fledged autoconf madness, because they break
on other platforms (Windows).

$ ./build all
...
clonecli5.c
/usr/bin/ld.bfd.real: clonecli5.o: undefined reference to symbol 
'uuid_generate@@UUID_1.0'
/usr/bin/ld.bfd.real: note: 'uuid_generate@@UUID_1.0' is defined in DSO 
/lib/libuuid.so.1 so try adding it to the linker command line
/lib/libuuid.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status


---
 examples/C/build |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/C/build b/examples/C/build
index a326d62..f499005 100755
--- a/examples/C/build
+++ b/examples/C/build
@@ -10,7 +10,7 @@ if [ /$1/ = /all/ ]; then
 echo "Building C examples..."
 for MAIN in `egrep -l "main \(" *.c`; do
 echo "$MAIN"
-./c -l -lzmq -lczmq -q $MAIN
+./c -l -lzmq -lczmq -luuid -q $MAIN
 done
 elif [ /$1/ = /clean/ ]; then
 echo "Cleaning C examples directory..."
@@ -20,7 +20,7 @@ elif [ /$1/ = /clean/ ]; then
 done
 elif [ -f $1.c ]; then
 echo "$1"
-./c -l -lzmq -lczmq -q $1
+./c -l -lzmq -lczmq -luuid -q $1
 else
 echo "syntax: build all | clean"
 fi
-- 
1.7.9

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev