[ 
https://issues.apache.org/jira/browse/FLUME-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13286386#comment-13286386
 ] 

Inder SIngh commented on FLUME-1246:
------------------------------------

I am hitting the same issue - Channel not starting.(easily reproducible)

Configuration
--------------
# Define a file channel called ch1 on agent1
agent1.channels.ch1.type = file

# Define an Avro source called avro-source1 on agent1 and tell it
# to bind to 0.0.0.0:41414. Connect it to channel ch1.
agent1.sources.avro-source1.channels = ch1
agent1.sources.avro-source1.type = avro
agent1.sources.avro-source1.bind = 0.0.0.0
agent1.sources.avro-source1.port = 41414

# Define a logger sink that simply logs all events it receives
# and connect it to the other end of the same channel.
agent1.sinks.log-sink1.channel = ch1
agent1.sinks.log-sink1.type = logger

# Finally, now that we've defined all of our components, tell
# agent1 which ones we want to activate.
agent1.channels = ch1
agent1.sources = avro-source1
agent1.sinks = log-sink1

Enabled DEBUG logs and subset of interest is ->
2012-05-31 12:39:42,513 INFO file.FileChannel: Starting FileChannel with 
dataDir [/Users/inderbir.singh/.flume/file-channel/data]
2012-05-31 12:39:42,513 INFO nodemanager.DefaultLogicalNodeManager: Starting 
Source avro-source1
2012-05-31 12:39:42,514 INFO source.AvroSource: Avro source 
starting:AvroSource: { bindAddress:0.0.0.0 port:41414 }
2012-05-31 12:39:42,516 DEBUG flume.SinkRunner: Polling sink runner starting
2012-05-31 12:39:42,521 ERROR flume.SinkRunner: Unhandled exception, logging 
and sleeping for 5000ms
java.lang.IllegalStateException: Channel closed
        at 
com.google.common.base.Preconditions.checkState(Preconditions.java:145)
        at 
org.apache.flume.channel.file.FileChannel.createTransaction(FileChannel.java:237)
        at 
org.apache.flume.channel.BasicChannelSemantics.getTransaction(BasicChannelSemantics.java:118)
        at org.apache.flume.sink.LoggerSink.process(LoggerSink.java:61)
        at 
org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
        at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
        at java.lang.Thread.run(Thread.java:680)
2012-05-31 12:39:42,885 DEBUG source.AvroSource: Avro source started

Triage
-------
FileChannel.start() makes open = true; it's being called as the log shows - 
"Starting FileChannel with dataDir "

Looks like before the channel is started i.e. start() is finished LoggerSink is 
calling createTransaction -> where Preconditions.checkState(open, "Channel 
closed"); finds open=false since start() wasn't complete and fails.

If my understanding is correct this is a race condition.

Sources/Sinks should allow the channel's to be started before proceeding with 
them.


                
> FileChannel failing to  start, also shutdown impossible without kill
> --------------------------------------------------------------------
>
>                 Key: FLUME-1246
>                 URL: https://issues.apache.org/jira/browse/FLUME-1246
>             Project: Flume
>          Issue Type: Bug
>          Components: Channel
>    Affects Versions: v1.2.0
>         Environment: CentOS 5.4
>            Reporter: Juhani Connolly
>         Attachments: flume.log, flume.log
>
>
> Reduced to a minimal configuration for simplicity. I can recreate this on 
> some machines, and not others. I wouldn't be surprised if it is some machines 
> specific issue(test machines on CentOS5.4. On some it worked, others not), 
> however whatever exception was thrown when attempting to get created is 
> consumed and never passed onwards
> Config:
> test.channels.ch1.type = file
> test.channels.ch1.checkpointDir = 
> /home/share/juhani_connolly/flume-1.2.0-incubating-SNAPSHOT/check
> test.channels.ch1.dataDirs = 
> /home/share/juhani_connolly/flume-1.2.0-incubating-SNAPSHOT/filechdata
> test.sources.top.type = exec
> test.sources.top.command = /usr/bin top -b -d 1
> test.sources.top.restart = true
> test.sources.top.restartThrottle = 1000
> test.sources.top.interceptors = ts
> test.sources.top.interceptors.ts.type = 
> org.apache.flume.interceptor.TimestampInterceptor$Builder
> test.sources.top.channels = ch1
> test.sinks.log.type = logger
> test.sinks.log.channel = ch1
> test.channels = ch1
> test.sources = top
> test.sinks = log
> attaching logs with general/lifecycle loglevel down to debug.
> A solution to this is probably going to be just improving error reporting.
> Another possibly more important element is that flume enters a state from 
> which it cannot shutdown without kill -9. It looks like the Interrupts are 
> getting swallowed up silently somewhere

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to