You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Yuri (Created) (JIRA)" <ji...@apache.org> on 2012/02/05 06:42:53 UTC

[jira] [Created] (HTTPASYNC-13) java.io.IOException: FileChannel.size() [13534] < position [130834]. Please grow the file before writing.

java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
----------------------------------------------------------------------------------------------------------

                 Key: HTTPASYNC-13
                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-13
             Project: HttpComponents HttpAsyncClient
          Issue Type: Bug
    Affects Versions: 4.0-alpha3
         Environment: OSX Leopard 64 bits, Java 1.6.
            Reporter: Yuri


I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:

00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_
java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]


--
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPASYNC-13) java.io.IOException: FileChannel.size() [13534] < position [130834]. Please grow the file before writing.

Posted by "Yuri (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPASYNC-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yuri updated HTTPASYNC-13:
--------------------------

    Description: 
I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:

00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_
java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]


This is what I am doing:


		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
				// overridden failed() and process()
		}


And the response is coming with an explicit Content-Length header, which seems to make the framework select the LengthDelimitedDecoder to decode the response. Now even if the server is reporting a wrong length in Content-Length, shouldnt the httpasyncclient simply produce a file of that size (even if not the complete file)? 

Could this be caused by the server reporting the wrong length? In any case, it seems that the code should never throw an exception here. It should 

  was:
I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:

00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_
java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]


This is what I am doing:


		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
				// overridden failed() and process()
		}


    
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPASYNC-13
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-13
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.0-alpha3
>         Environment: OSX Leopard 64 bits, Java 1.6.
>            Reporter: Yuri
>
> I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:
> 00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> 	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]
> This is what I am doing:
> 		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
> 		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
> 				// overridden failed() and process()
> 		}
> And the response is coming with an explicit Content-Length header, which seems to make the framework select the LengthDelimitedDecoder to decode the response. Now even if the server is reporting a wrong length in Content-Length, shouldnt the httpasyncclient simply produce a file of that size (even if not the complete file)? 
> Could this be caused by the server reporting the wrong length? In any case, it seems that the code should never throw an exception here. It should 

--
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPASYNC-13) java.io.IOException: FileChannel.size() [13534] < position [130834]. Please grow the file before writing.

Posted by "Oleg Kalnichevski (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPASYNC-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200783#comment-13200783 ] 

Oleg Kalnichevski commented on HTTPASYNC-13:
--------------------------------------------

I tested the url (http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_ ) with both 4.0a3 and the latest SVN snapshot and was unable to reproduce the exception. The problem appears to be caused by a condition whereby an attempt is made to write outside the writable area of the file (beyond the end of file). This seems to suggest a bug in ZeroCopyConsumer. However, unless I am able to reproduce the problem I'll have no other choice but close this issue as CANT REPRODUCE. Is the problem intermittent or can be reliably reproduced under the same conditions? 

Oleg
                
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPASYNC-13
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-13
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.0-alpha3
>         Environment: OSX Leopard 64 bits, Java 1.6.
>            Reporter: Yuri
>
> I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:
> 00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> 	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]
> This is what I am doing:
> 		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
> 		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
> 				// overridden failed() and process()
> 		}
> And the response is coming with an explicit Content-Length header, which seems to make the framework select the LengthDelimitedDecoder to decode the response. Now even if the server is reporting a wrong length in Content-Length, shouldnt the httpasyncclient simply produce a file of that size (even if not the complete file)? 
> Could this be caused by the server reporting the wrong length? In any case, it seems that the code should never throw an exception here. It should 

--
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPASYNC-13) java.io.IOException: FileChannel.size() [13534] < position [130834]. Please grow the file before writing.

Posted by "Yuri (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPASYNC-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yuri updated HTTPASYNC-13:
--------------------------

    Description: 
I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:

00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_
java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]


This is what I am doing:


		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
				// overridden failed() and process()
		}


  was:
I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:

00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_
java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]


    
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPASYNC-13
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-13
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.0-alpha3
>         Environment: OSX Leopard 64 bits, Java 1.6.
>            Reporter: Yuri
>
> I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:
> 00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> 	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]
> This is what I am doing:
> 		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
> 		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
> 				// overridden failed() and process()
> 		}

--
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Updated] (HTTPASYNC-13) java.io.IOException: FileChannel.size() [13534] < position [130834]. Please grow the file before writing.

Posted by "Yuri (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPASYNC-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yuri updated HTTPASYNC-13:
--------------------------

    Description: 
I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:

00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.blah.com/files/file20110101.ex_
java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]


This is what I am doing:


		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
				// overridden failed() and process()
		}


And the response is coming with an explicit Content-Length header, which seems to make the framework select the LengthDelimitedDecoder to decode the response. Now even if the server is reporting a wrong length in Content-Length, shouldnt the httpasyncclient simply produce a file of that size (even if not the complete file)? 

Could this be caused by the server reporting the wrong length? In any case, it seems that the code should never throw an exception here. It should 

  was:
I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:

00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.bmf.com.br/Ftp/ContratosPregaoFinal/BF120104.ex_
java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]


This is what I am doing:


		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
				// overridden failed() and process()
		}


And the response is coming with an explicit Content-Length header, which seems to make the framework select the LengthDelimitedDecoder to decode the response. Now even if the server is reporting a wrong length in Content-Length, shouldnt the httpasyncclient simply produce a file of that size (even if not the complete file)? 

Could this be caused by the server reporting the wrong length? In any case, it seems that the code should never throw an exception here. It should 

    
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPASYNC-13
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-13
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.0-alpha3
>         Environment: OSX Leopard 64 bits, Java 1.6.
>            Reporter: Yuri
>
> I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:
> 00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.blah.com/files/file20110101.ex_
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> 	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]
> This is what I am doing:
> 		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
> 		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
> 				// overridden failed() and process()
> 		}
> And the response is coming with an explicit Content-Length header, which seems to make the framework select the LengthDelimitedDecoder to decode the response. Now even if the server is reporting a wrong length in Content-Length, shouldnt the httpasyncclient simply produce a file of that size (even if not the complete file)? 
> Could this be caused by the server reporting the wrong length? In any case, it seems that the code should never throw an exception here. It should 

--
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Resolved] (HTTPASYNC-13) java.io.IOException: FileChannel.size() [13534] < position [130834]. Please grow the file before writing.

Posted by "Oleg Kalnichevski (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPASYNC-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPASYNC-13.
----------------------------------------

    Resolution: Cannot Reproduce

Yuri,

I reviewed LengthDelimitedDecoder and ZeroCopyConsumer code and could not find any logical condition that might lead to an attempt to transfer data at a position past end of file.

Please re-open this issue if you find a reliable way to reproduce the problem.

Oleg
                
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPASYNC-13
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-13
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.0-alpha3
>         Environment: OSX Leopard 64 bits, Java 1.6.
>            Reporter: Yuri
>
> I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:
> 00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.blah.com/files/file20110101.ex_
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> 	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]
> This is what I am doing:
> 		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
> 		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
> 				// overridden failed() and process()
> 		}
> And the response is coming with an explicit Content-Length header, which seems to make the framework select the LengthDelimitedDecoder to decode the response. Now even if the server is reporting a wrong length in Content-Length, shouldnt the httpasyncclient simply produce a file of that size (even if not the complete file)? 
> Could this be caused by the server reporting the wrong length? In any case, it seems that the code should never throw an exception here. It should 

--
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] [Commented] (HTTPASYNC-13) java.io.IOException: FileChannel.size() [13534] < position [130834]. Please grow the file before writing.

Posted by "Yuri (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPASYNC-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200814#comment-13200814 ] 

Yuri commented on HTTPASYNC-13:
-------------------------------

It happens all the time here but I would need some time to create a testcase I can attach here.

Another piece of info is that I am taking a 1 year interval command and executing as hundreds of individual download executions, one for each trading day, in one shot on a dual-core CPU (MacBook Pro) and let the httpasyncclient asynchronously catch up with the downloads. While executing the batch of downloads I see many that work and many that fail with the above error.


                
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPASYNC-13
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-13
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.0-alpha3
>         Environment: OSX Leopard 64 bits, Java 1.6.
>            Reporter: Yuri
>
> I am using httpasyncclient to download many files assynchronously. Each download get's a unique temp file. For some of the download in the series this is what I see:
> 00:36:00.343 |-ERROR [I/O dispatcher 3] [   c.b.q.h.HttpDownloader] - Could not download http://www.blah.com/files/file20110101.ex_
> java.io.IOException: FileChannel.size() [13534] < position [130834].  Please grow the file before writing.
> 	at org.apache.http.impl.nio.codecs.LengthDelimitedDecoder.transfer(LengthDelimitedDecoder.java:145) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.nio.client.methods.ZeroCopyConsumer.onContentReceived(ZeroCopyConsumer.java:75) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:67) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.consumeContent(DefaultAsyncRequestDirector.java:329) ~[httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.nio.protocol.HttpAsyncClientProtocolHandler.inputReady(HttpAsyncClientProtocolHandler.java:226) ~[httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.client.LoggingClientProtocolHandler.inputReady(LoggingClientProtocolHandler.java:98) [httpasyncclient-4.0-alpha3.jar:4.0-alpha3]
> 	at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:175) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:118) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.DefaultClientIODispatch.onInputReady(DefaultClientIODispatch.java:49) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.AbstractIODispatch.inputReady(AbstractIODispatch.java:113) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:160) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:320) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:280) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:599) [httpcore-nio-4.2-alpha2.jar:4.2-alpha2]
> 	at java.lang.Thread.run(Thread.java:680) [na:1.6.0_29]
> This is what I am doing:
> 		HttpAsyncRequestProducer download = HttpAsyncMethods.createGet(uri);
> 		getHttpClient().execute(download, new ZeroCopyConsumer<Void>(file) {
> 				// overridden failed() and process()
> 		}
> And the response is coming with an explicit Content-Length header, which seems to make the framework select the LengthDelimitedDecoder to decode the response. Now even if the server is reporting a wrong length in Content-Length, shouldnt the httpasyncclient simply produce a file of that size (even if not the complete file)? 
> Could this be caused by the server reporting the wrong length? In any case, it seems that the code should never throw an exception here. It should 

--
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org