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

PruducerSendThread Die #14

Open
Kimjonghyeon opened this issue Dec 24, 2015 · 0 comments
Open

PruducerSendThread Die #14

Kimjonghyeon opened this issue Dec 24, 2015 · 0 comments

Comments

@Kimjonghyeon
Copy link

  1. Async Producer server
    AsyncProducer.send(...) : throw QueueFullException occurred
    -> Still in the message transfer request
  2. Broker server die
  3. Producer server
    java.lang.RuntimeException: org.apache.thrift.transport.TTransportException: java.net.SocketException: Connection reset
  4. queue.addAll(events) execute
private void tryToHandle(List<QueueItem<T>> events) {
    if (logger.isDebugEnabled()) {
        logger.debug("handling " + events.size() + " events");
    }
    if (events.size() > 0) {
        try {
            this.eventHandler.handle(events, underlyingProducer, serializer);
        } catch (ConnectionRefusedException e) {
            List<QueueItem<T>> remainedItems = new ArrayList<QueueItem<T>>(events);
            while (queue.size() > 0) {
                remainedItems.add(queue.poll());
            }
            if (this.callbackHandler != null) {
                this.callbackHandler.connectionRefused(e.getMessage(), remainedItems);
            }
        } catch (RuntimeException e) {
            logger.error("Error in handling batch of " + events.size() + " events", e);
            queue.addAll(events);
        }
    }
}

Queue full & ProducerSendThread die.

java.lang.IllegalStateException: Queue full
        at java.util.AbstractQueue.add(AbstractQueue.java:98)
        at java.util.AbstractQueue.addAll(AbstractQueue.java:187)
        at com.leansoft.luxun.producer.async.ProducerSendThread.tryToHandle(ProducerSendThread.java:163)
        at com.leansoft.luxun.producer.async.ProducerSendThread.processEvents(ProducerSendThread.java:126)
        at com.leansoft.luxun.producer.async.ProducerSendThread.run(ProducerSendThread.java:63) 

solution

  1. IllegalStateException occurred
  2. tryToHandle(events) -> re execute
  3. Thrift connection attempt
  4. Connection attempt timeout.
  5. ConnectionRefusedException occurred
  6. CallbackHandler.connectionRefused(...) execute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant