question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZMQ.REQ regression since 0.4.0

See original GitHub issue

I am writing a library that communicates with the ZeroMQ server of OpenNMT. This code works using 0.3.6, but hangs on the receiving using any 0.4.x branch.

    public OpenNMTZeroMQClient(String host, int port) {
        this.context = ZMQ.context(2);
        this.socket = context.socket(ZMQ.REQ);
        String hostAddress = "tcp://" + host + ":" + port;
        LOG.info("Connecting to '{}'", hostAddress);
        socket.connect(hostAddress);
    }


    public void translate(String text) {
        String js = new JSONArray()
                .put(new JSONObject()
                        .put("src", text))
                .toString();
        LOG.info("Sending '{}'...", js);
        boolean wasSent = socket.send(js.getBytes(ZMQ.CHARSET), 0);
        if(wasSent) {
            LOG.info("Sent!");
        }
        LOG.info("Receiving...");
        String reply = socket.recvStr();
        LOG.info("Received: '{}'", reply);
    }

    public void close() {
        if(this.socket != null) {
            this.socket.close();
        }
        if(this.context != null) {
            this.context.term();
        }
    }

It doesn’t actually fail, but it just hangs on the recv() call. The server didn’t receive anything, so the problem is probably that the send never happened.

EDIT: code formatting

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
zezkecommented, Nov 28, 2017

@fredoboulo The 0.4.3 release does indeed fix the issue. Thanks a bunch and sorry for the delay on my end!

0reactions
daveyarwoodcommented, Nov 16, 2017

Seems good to me. My email is on my profile too, definitely feel free to email me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade 0.3.4 to 0.4.2 -> Windows running out of ports #495
With jeromq-0.4.2 the number increases until after some thousands the system is running out of ports ... ZMQ.REQ regression since 0.4.0 #497.
Read more >
ZMQ (JeroMQ 0.4.0 API) - Javadoc.io
ROUTER is the socket that creates and consumes request-reply routing envelopes. It is the only socket type that lets you route messages to...
Read more >
Chapter 4 - Reliable Request-Reply Patterns - ZeroMQ guide
In this chapter, we focus heavily on user-space request-reply patterns, reusable models that help you design your own ZeroMQ architectures: The Lazy Pirate ......
Read more >
Log4j – Changes - Apache Logging Services
Fix regression in Rfc5424Layout default values. Fixes LOG4J2-3587. Thanks to Tomas Micko. ... Update ZeroMQ's JeroMQ from 0.4.0 to 0.4.1.
Read more >
Bug listing with status RESOLVED with resolution TEST ...
status:RESOLVED resolution:TEST-REQUEST severity:critical ... regression in playlist handling: cannot open some files after audacious restarting" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found