Twitter River : stopping after an arror

Hi there,

I started a twitter river on a ec2 instance but it failed after 1 hour and
half.

It didn't restart automatically even if river displayed "stream failure,
restarting stream..." in logs.

Any thoughts ?

Should I open a bug ?

[2012-03-21 21:53:36,025][INFO ][river.twitter ] [Callisto]
[twitter][twitter] creating twitter stream river for [null]

[2012-03-21 21:53:36,137][INFO ][river.twitter ] [Callisto]
[twitter][twitter] starting twitter stream

[2012-03-21 21:53:36,269][INFO ][twitter4j.TwitterStreamImpl] Establishing
connection.

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Connection
established.

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Receiving
status stream.

[2012-03-21 23:17:45,903][INFO ][twitter4j.TwitterStreamImpl] Stream closed.

[2012-03-21 23:17:45,904][WARN ][river.twitter ] [Callisto]
[twitter][twitter] stream failure, restarting stream...

Stream closed.Relevant discussions can be on the Internet at:

    http://www.google.co.jp/search?q=70971d2e or

    http://www.google.co.jp/search?q=000687bf

TwitterException{exceptionCode=[70971d2e-000687bf 70971d2e-0006876e],
statusCode=-1, retryAfter=-1, rateLimitStatus=null,
featureSpecificRateLimitStatus=null, version=2.2.5}

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImple
mentation.java:167)

    at twitter4j.StatusStreamImpl.next(StatusStreamImpl.java:67)

    at

twitter4j.TwitterStreamImpl$TwitterStreamConsumer.run(TwitterStreamImpl.java
:443)

Caused by: java.io.IOException: Premature EOF

    at

sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.jav
a:556)

    at

sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600)

    at

sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)

    at java.io.FilterInputStream.read(FilterInputStream.java:133)

    at

sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConn
ection.java:2582)

    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)

    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)

    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)

    at java.io.InputStreamReader.read(InputStreamReader.java:184)

    at java.io.BufferedReader.fill(BufferedReader.java:153)

    at java.io.BufferedReader.readLine(BufferedReader.java:316)

    at java.io.BufferedReader.readLine(BufferedReader.java:379)

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImple
mentation.java:86)

    ... 2 more

Thanks,

David.

Strange..., maybe you can recreate it with a TRACE log level set on
river.twitter?

On Thu, Mar 22, 2012 at 9:28 PM, David Pilato david@pilato.fr wrote:

Hi there,****



I started a twitter river on a ec2 instance but it failed after 1 hour and
half.****

It didn’t restart automatically even if river displayed “stream failure,
restarting stream...” in logs.****


Any thoughts ?****

Should I open a bug ?****


[2012-03-21 21:53:36,025][INFO ][river.twitter ] [Callisto]
[twitter][twitter] creating twitter stream river for [null]****

[2012-03-21 21:53:36,137][INFO ][river.twitter ] [Callisto]
[twitter][twitter] starting twitter stream****

[2012-03-21 21:53:36,269][INFO ][twitter4j.TwitterStreamImpl] Establishing
connection.****

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Connection
established.****

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Receiving
status stream.****

[2012-03-21 23:17:45,903][INFO ][twitter4j.TwitterStreamImpl] Stream
closed.****

[2012-03-21 23:17:45,904][WARN ][river.twitter ] [Callisto]
[twitter][twitter] stream failure, restarting stream...****

Stream closed.Relevant discussions can be on the Internet at:****

    http://www.google.co.jp/search?q=70971d2e or****

    http://www.google.co.jp/search?q=000687bf****

TwitterException{exceptionCode=[70971d2e-000687bf 70971d2e-0006876e],
statusCode=-1, retryAfter=-1, rateLimitStatus=null,
featureSpecificRateLimitStatus=null, version=2.2.5}****

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImplementation.java:167)


    at twitter4j.StatusStreamImpl.next(StatusStreamImpl.java:67)****

    at

twitter4j.TwitterStreamImpl$TwitterStreamConsumer.run(TwitterStreamImpl.java:443)


Caused by: java.io.IOException: Premature EOF****

    at

sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:556)


    at

sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600)


    at

sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)****

    at java.io.FilterInputStream.read(FilterInputStream.java:133)****

    at

sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2582)


    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)****

    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)****

    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)****

    at java.io.InputStreamReader.read(InputStreamReader.java:184)****

    at java.io.BufferedReader.fill(BufferedReader.java:153)****

    at java.io.BufferedReader.readLine(BufferedReader.java:316)****

    at java.io.BufferedReader.readLine(BufferedReader.java:379)****

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImplementation.java:86)


    ... 2 more****

Thanks,****

David.****

Hi Shay,

I finally got the error again. Traces are here :

You will see that

2012-03-29 05:13:11,994][WARN ][river.twitter ] [Princess Python]
[twitter][devoxx] stream failure, restarting stream...

And then every hour :

[2012-03-29 09:40:56,945][DEBUG][http.netty ] [Princess
Python] Caught exception while handling client http traffic, closing
connection [id: 0x007b7258, /195.101.137.28:2806 => /10.28.31.164:80]

java.io.IOException: Connection timed out

     at sun.nio.ch.FileDispatcher.read0(Native Method)

     at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)

     at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:251)

     at sun.nio.ch.IOUtil.read(IOUtil.java:218)

     at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:254)

     at

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.j
ava:315)

     at

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.processSelectedK
eys(NioWorker.java:274)

     at

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.ja
va:194)

     at

org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamin
gRunnable.java:102)

     at

org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadL
ockProofWorker.java:42)

     at

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
10)

     at

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
03)

     at java.lang.Thread.run(Thread.java:679)

What do you think ?

Thanks

David.

De : elasticsearch@googlegroups.com [mailto:elasticsearch@googlegroups.com]
De la part de Shay Banon
Envoyé : dimanche 25 mars 2012 13:38
À : elasticsearch@googlegroups.com
Objet : Re: Twitter River : stopping after an arror

Strange..., maybe you can recreate it with a TRACE log level set on
river.twitter?

On Thu, Mar 22, 2012 at 9:28 PM, David Pilato david@pilato.fr wrote:

Hi there,

I started a twitter river on a ec2 instance but it failed after 1 hour and
half.

It didn’t restart automatically even if river displayed “stream failure,
restarting stream...” in logs.

Any thoughts ?

Should I open a bug ?

[2012-03-21 21:53:36,025][INFO ][river.twitter ] [Callisto]
[twitter][twitter] creating twitter stream river for [null]

[2012-03-21 21:53:36,137][INFO ][river.twitter ] [Callisto]
[twitter][twitter] starting twitter stream

[2012-03-21 21:53:36,269][INFO ][twitter4j.TwitterStreamImpl] Establishing
connection.

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Connection
established.

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Receiving
status stream.

[2012-03-21 23:17:45,903][INFO ][twitter4j.TwitterStreamImpl] Stream closed.

[2012-03-21 23:17:45,904][WARN ][river.twitter ] [Callisto]
[twitter][twitter] stream failure, restarting stream...

Stream closed.Relevant discussions can be on the Internet at:

    http://www.google.co.jp/search?q=70971d2e or

    http://www.google.co.jp/search?q=000687bf

TwitterException{exceptionCode=[70971d2e-000687bf 70971d2e-0006876e],
statusCode=-1, retryAfter=-1, rateLimitStatus=null,
featureSpecificRateLimitStatus=null, version=2.2.5}

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImple
mentation.java:167)

    at twitter4j.StatusStreamImpl.next(StatusStreamImpl.java:67)

    at

twitter4j.TwitterStreamImpl$TwitterStreamConsumer.run(TwitterStreamImpl.java
:443)

Caused by: java.io.IOException: Premature EOF

    at

sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.jav
a:556)

    at

sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600)

    at

sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)

    at java.io.FilterInputStream.read(FilterInputStream.java:133)

    at

sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConn
ection.java:2582)

    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)

    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)

    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)

    at java.io.InputStreamReader.read(InputStreamReader.java:184)

    at java.io.BufferedReader.fill(BufferedReader.java:153)

    at java.io.BufferedReader.readLine(BufferedReader.java:316)

    at java.io.BufferedReader.readLine(BufferedReader.java:379)

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImple
mentation.java:86)

    ... 2 more

Thanks,

David.

Hi Shay,

Sorry to nag. Could you give a look at this log file ?

I have to restart my instance (or delete the river and recreate it) about
every two or three days.

Any idea ?

Thanks

David.

De : elasticsearch@googlegroups.com [mailto:elasticsearch@googlegroups.com]
De la part de David Pilato
Envoyé : jeudi 29 mars 2012 19:24
À : elasticsearch@googlegroups.com
Objet : RE: Twitter River : stopping after an arror

Hi Shay,

I finally got the error again. Traces are here :

You will see that

2012-03-29 05:13:11,994][WARN ][river.twitter ] [Princess Python]
[twitter][devoxx] stream failure, restarting stream...

And then every hour :

[2012-03-29 09:40:56,945][DEBUG][http.netty ] [Princess
Python] Caught exception while handling client http traffic, closing
connection [id: 0x007b7258, /195.101.137.28:2806 => /10.28.31.164:80]

java.io.IOException: Connection timed out

     at sun.nio.ch.FileDispatcher.read0(Native Method)

     at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)

     at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:251)

     at sun.nio.ch.IOUtil.read(IOUtil.java:218)

     at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:254)

     at

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.j
ava:315)

     at

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.processSelectedK
eys(NioWorker.java:274)

     at

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.ja
va:194)

     at

org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamin
gRunnable.java:102)

     at

org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadL
ockProofWorker.java:42)

     at

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
10)

     at

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
03)

     at java.lang.Thread.run(Thread.java:679)

What do you think ?

Thanks

David.

De : elasticsearch@googlegroups.com [mailto:elasticsearch@googlegroups.com]
De la part de Shay Banon
Envoyé : dimanche 25 mars 2012 13:38
À : elasticsearch@googlegroups.com
Objet : Re: Twitter River : stopping after an arror

Strange..., maybe you can recreate it with a TRACE log level set on
river.twitter?

On Thu, Mar 22, 2012 at 9:28 PM, David Pilato david@pilato.fr wrote:

Hi there,

I started a twitter river on a ec2 instance but it failed after 1 hour and
half.

It didn’t restart automatically even if river displayed “stream failure,
restarting stream...” in logs.

Any thoughts ?

Should I open a bug ?

[2012-03-21 21:53:36,025][INFO ][river.twitter ] [Callisto]
[twitter][twitter] creating twitter stream river for [null]

[2012-03-21 21:53:36,137][INFO ][river.twitter ] [Callisto]
[twitter][twitter] starting twitter stream

[2012-03-21 21:53:36,269][INFO ][twitter4j.TwitterStreamImpl] Establishing
connection.

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Connection
established.

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Receiving
status stream.

[2012-03-21 23:17:45,903][INFO ][twitter4j.TwitterStreamImpl] Stream closed.

[2012-03-21 23:17:45,904][WARN ][river.twitter ] [Callisto]
[twitter][twitter] stream failure, restarting stream...

Stream closed.Relevant discussions can be on the Internet at:

    http://www.google.co.jp/search?q=70971d2e or

    http://www.google.co.jp/search?q=000687bf

TwitterException{exceptionCode=[70971d2e-000687bf 70971d2e-0006876e],
statusCode=-1, retryAfter=-1, rateLimitStatus=null,
featureSpecificRateLimitStatus=null, version=2.2.5}

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImple
mentation.java:167)

    at twitter4j.StatusStreamImpl.next(StatusStreamImpl.java:67)

    at

twitter4j.TwitterStreamImpl$TwitterStreamConsumer.run(TwitterStreamImpl.java
:443)

Caused by: java.io.IOException: Premature EOF

    at

sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.jav
a:556)

    at

sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600)

    at

sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)

    at java.io.FilterInputStream.read(FilterInputStream.java:133)

    at

sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConn
ection.java:2582)

    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)

    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)

    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)

    at java.io.InputStreamReader.read(InputStreamReader.java:184)

    at java.io.BufferedReader.fill(BufferedReader.java:153)

    at java.io.BufferedReader.readLine(BufferedReader.java:316)

    at java.io.BufferedReader.readLine(BufferedReader.java:379)

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImple
mentation.java:86)

    ... 2 more

Thanks,

David.

I don't see anything interesting there, strange... . Based on teh code, it
seems like the twitter4j library is being properly restarted and we try to
reconnet properly, I will try and recreate it...

On Thu, Apr 5, 2012 at 1:12 AM, David Pilato david@pilato.fr wrote:

Hi Shay,****



Sorry to nag. Could you give a look at this log file ?****

I have to restart my instance (or delete the river and recreate it) about
every two or three days.****


Any idea ?****

Thanks****

David.****


De : elasticsearch@googlegroups.com [mailto:
elasticsearch@googlegroups.com] De la part de David Pilato
Envoyé : jeudi 29 mars 2012 19:24
À : elasticsearch@googlegroups.com
Objet : RE: Twitter River : stopping after an arror****


Hi Shay,****



I finally got the error again. Traces are here :
ES Twitter River log · GitHub****


You will see that****

2012-03-29 05:13:11,994][WARN ][river.twitter ] [Princess
Python] [twitter][devoxx] stream failure, restarting stream...****



And then every hour :****

[2012-03-29 09:40:56,945][DEBUG][http.netty ] [Princess
Python] Caught exception while handling client http traffic, closing
connection [id: 0x007b7258, /195.101.137.28:2806 => /10.28.31.164:80]****

java.io.IOException: Connection timed out****

     at sun.nio.ch.FileDispatcher.read0(Native Method)****

     at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)****

     at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:251)****

     at sun.nio.ch.IOUtil.read(IOUtil.java:218)****

     at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:254)*

     at

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:315)


     at

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:274)


     at

org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:194)


     at

org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102)


     at

org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)


     at

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)


     at

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)


     at java.lang.Thread.run(Thread.java:679)****



What do you think ?****


Thanks****

David.****



De : elasticsearch@googlegroups.com [
mailto:elasticsearch@googlegroups.com elasticsearch@googlegroups.com] De
la part de
Shay Banon
Envoyé : dimanche 25 mars 2012 13:38
À : elasticsearch@googlegroups.com
Objet : Re: Twitter River : stopping after an arror****


Strange..., maybe you can recreate it with a TRACE log level set on
river.twitter?****

On Thu, Mar 22, 2012 at 9:28 PM, David Pilato david@pilato.fr wrote:****

Hi there,****



I started a twitter river on a ec2 instance but it failed after 1 hour and
half.****

It didn’t restart automatically even if river displayed “stream failure,
restarting stream...” in logs.****


Any thoughts ?****

Should I open a bug ?****


[2012-03-21 21:53:36,025][INFO ][river.twitter ] [Callisto]
[twitter][twitter] creating twitter stream river for [null]****

[2012-03-21 21:53:36,137][INFO ][river.twitter ] [Callisto]
[twitter][twitter] starting twitter stream****

[2012-03-21 21:53:36,269][INFO ][twitter4j.TwitterStreamImpl] Establishing
connection.****

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Connection
established.****

[2012-03-21 21:53:36,965][INFO ][twitter4j.TwitterStreamImpl] Receiving
status stream.****

[2012-03-21 23:17:45,903][INFO ][twitter4j.TwitterStreamImpl] Stream
closed.****

[2012-03-21 23:17:45,904][WARN ][river.twitter ] [Callisto]
[twitter][twitter] stream failure, restarting stream...****

Stream closed.Relevant discussions can be on the Internet at:****

    http://www.google.co.jp/search?q=70971d2e or****

    http://www.google.co.jp/search?q=000687bf****

TwitterException{exceptionCode=[70971d2e-000687bf 70971d2e-0006876e],
statusCode=-1, retryAfter=-1, rateLimitStatus=null,
featureSpecificRateLimitStatus=null, version=2.2.5}****

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImplementation.java:167)


    at twitter4j.StatusStreamImpl.next(StatusStreamImpl.java:67)****

    at

twitter4j.TwitterStreamImpl$TwitterStreamConsumer.run(TwitterStreamImpl.java:443)


Caused by: java.io.IOException: Premature EOF****

    at

sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:556)


    at

sun.net.www.http.ChunkedInputStream.readAhead(ChunkedInputStream.java:600)


    at

sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:687)****

    at java.io.FilterInputStream.read(FilterInputStream.java:133)****

    at

sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2582)


    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282)****

    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324)****

    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176)****

    at java.io.InputStreamReader.read(InputStreamReader.java:184)****

    at java.io.BufferedReader.fill(BufferedReader.java:153)****

    at java.io.BufferedReader.readLine(BufferedReader.java:316)****

    at java.io.BufferedReader.readLine(BufferedReader.java:379)****

    at

twitter4j.AbstractStreamImplementation.handleNextElement(AbstractStreamImplementation.java:86)


    ... 2 more****

Thanks,****

David.****


I have the same trouble with twitter river.
You can easy to repeat this bug if temporary disconnect your network.
After error in log:
... stream failure, restarting stream...
You can switch your network on, but twitter river can't turn back.

Could I restart the river without shutting down cluster?

--

Same for me.
Have a look at this old thread: https://groups.google.com/forum/?fromgroups=&nomobile=true#!search/Twitter$20stream$20pilato/elasticsearch/6OTSds3DSSg/oK9KdCsm6mkJ

I did not find any way to fix it.
So, I created a crontab script that look at logs and restart the node each time I see the error. The other node (2 nodes cluster) recreate the river and continue to fetch Twitter content.

Here is a gist: https://gist.github.com/4020312

HTH

David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 5 nov. 2012 à 12:32, Mikola Senyk mikola.senyk@gmail.com a écrit :

I have the same trouble with twitter river.
You can easy to repeat this bug if temporary disconnect your network.
After error in log:
... stream failure, restarting stream...
You can switch your network on, but twitter river can't turn back.

Could I restart the river without shutting down cluster?

--

Thank you David!
Your crontab script is nice temporary solution.

--

Hi,

First to mention, I am not much into core elasticsearch code, but I do
quite a bit of custom modification on the plugins part to support my
business cases. My statement here might sound too novice. My apologies.

I had faced the same problem stated here in this thread while I built the
plugin directly using command as stated in link

I needed to modify the code of twitter river several times for custom
requirements, and have faced two compilation problems. Resolving those
problems and building the jar on my end has incidentally resolved
this re-connection problem. (I am using elasticsearch 0.19.9)

Following are the changes I made in the code. I am really not very sure
whether I made the correct changes or not, the experts can really help
better here, but those just worked for me.

        // TODO, we can update the status of the river to RECONNECT
        logger.warn("failed to connect after failure, throttling", e);
        threadPool.schedule(TimeValue.timeValueSeconds(10), 

ThreadPool.Names.CACHED, new Runnable() {
@Override
public void run() {
reconnect();
}
});

changed to

        // TODO, we can update the status of the river to RECONNECT
        logger.warn("failed to connect after failure, throttling", e);
        threadPool.schedule(TimeValue.timeValueSeconds(10), 

ThreadPool.Names.CACHE, new Runnable() {
@Override
public void run() {
reconnect();
}
});

and ..

    public void onException(Exception ex) {
        logger.warn("stream failure, restarting stream...", ex);
        threadPool.cached().execute(new Runnable() {
            @Override
            public void run() {
                reconnect();
            }
        });
    }

changed to

    @Override
    public void onException(Exception ex) {
        logger.warn("stream failure, restarting stream...", ex);
        threadPool.executor("CACHED").execute(new Runnable() {
            @Override
            public void run() {
                reconnect();
            }
        });
    }

And to emphasize, these were creating compilation problem at my end, I
didn't just do a random code change. Also when using behind corporate
firewall, the following open issue described at
https://github.com/elasticsearch/elasticsearch-river-twitter/issues/15 needs
to be addressed.

Regards,
-- Sujoy

On Tuesday, November 6, 2012 12:37:15 PM UTC+5:30, Mikola Senyk wrote:

Thank you David!
Your crontab script is nice temporary solution.

--

The last change should be -

public void onException(Exception ex) {
logger.warn("stream failure, restarting stream...", ex);
threadPool.executor(ThreadPool.Names.CACHE).execute(new Runnable() {
@Override
public void run()
{
logger.debug(" executing reconnection ");
reconnect();
}
});
}

Sorry, that I copied from a wrong development location. :frowning:

  • Sujoy

On Thursday, November 8, 2012 11:31:59 AM UTC+5:30, Sujoy Sett wrote:

Hi,

First to mention, I am not much into core elasticsearch code, but I do
quite a bit of custom modification on the plugins part to support my
business cases. My statement here might sound too novice. My apologies.

I had faced the same problem stated here in this thread while I built the
plugin directly using command as stated in link
GitHub - elastic/elasticsearch-river-twitter: Twitter River Plugin for elasticsearch (STOPPED)

I needed to modify the code of twitter river several times for custom
requirements, and have faced two compilation problems. Resolving those
problems and building the jar on my end has incidentally resolved
this re-connection problem. (I am using elasticsearch 0.19.9)

Following are the changes I made in the code. I am really not very sure
whether I made the correct changes or not, the experts can really help
better here, but those just worked for me.

        // TODO, we can update the status of the river to RECONNECT
        logger.warn("failed to connect after failure, throttling", e);
        threadPool.schedule(TimeValue.timeValueSeconds(10), 

ThreadPool.Names.CACHED, new Runnable() {
@Override
public void run() {
reconnect();
}
});

changed to

        // TODO, we can update the status of the river to RECONNECT
        logger.warn("failed to connect after failure, throttling", e);
        threadPool.schedule(TimeValue.timeValueSeconds(10), 

ThreadPool.Names.CACHE, new Runnable() {
@Override
public void run() {
reconnect();
}
});

and ..

    public void onException(Exception ex) {
        logger.warn("stream failure, restarting stream...", ex);
        threadPool.cached().execute(new Runnable() {
            @Override
            public void run() {
                reconnect();
            }
        });
    }

changed to

    @Override
    public void onException(Exception ex) {
        logger.warn("stream failure, restarting stream...", ex);
        threadPool.executor("CACHED").execute(new Runnable() {
            @Override
            public void run() {
                reconnect();
            }
        });
    }

And to emphasize, these were creating compilation problem at my end, I
didn't just do a random code change. Also when using behind corporate
firewall, the following open issue described at
https://github.com/elasticsearch/elasticsearch-river-twitter/issues/15 needs
to be addressed.

Regards,
-- Sujoy

On Tuesday, November 6, 2012 12:37:15 PM UTC+5:30, Mikola Senyk wrote:

Thank you David!
Your crontab script is nice temporary solution.

--