[zeromq-dev] Java API is not notifed of C++ assert failures.

Martin Sustrik sustrik at fastmq.com
Thu Mar 12 18:12:17 CET 2009


Hm,

I'm not a Win32 expert, but the assert should crash the whole process 
rather then allowing Java to continue. We'll investigate the issue.

As for your algorithm for determining the primary server, it's pretty 
dangerous. Consider the case where your enterprise grows rapidly and 
you'll have to manage large set of services all over the world. In such 
case using simple zmq_server to keep track of locations of global 
objects won't do. You would need something more enterprisey, possibly 
the Active Directory or LDAP. If so, your database will be distributed 
over different geographical locations and possibly temporarily 
dissynchronised. That would in turn allow 2 instances to become primary 
incidentally and thus introduce the split-brain syndrome.

In short, automatic selection of primary is a complex problem studied 
extensively by distributed algorithm scientists and as far as I am aware 
it has no generic solution. My advice would be to select primary by hand 
if at all possible.

Martin

Vladimir & Mihaela wrote:
> Hi,
> 
> In the Java API I am trying to implement a schema where the first process
> that comes up becomes primary and all the rest become secondary.
> 
> Every process that comes up will try to create a global object with a global
> name. If that process receives an error (name collision) then it will
> conclude that it is secondary and will create it's local counterpart object
> instead.
> 
> When I start the second instance of my process and it tries to create a
> global object that already exists, I get a Windows 'assertion failed' popup.
> However, Java still thinks that the operation succeeded.
> 
> Is there a way to transfer these exceptions to Java?
> 
> Thanks,
> Vladimir
> 
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev




More information about the zeromq-dev mailing list