[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2019-04-01 Thread Hudson (JIRA)


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

Hudson commented on AVRO-813:
-

FAILURE: Integrated in Jenkins build AvroJava #634 (See 
[https://builds.apache.org/job/AvroJava/634/])
[AVRO-813] Keep the InputStream contract of -1 for eof Patch from Bruno (dkulp: 
[https://github.com/apache/avro/commit/a5e0f4ad01703eb4a724e71dfcf99306819c6bf3])
* (edit) 
lang/java/avro/src/main/java/org/apache/avro/util/ByteBufferInputStream.java


> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
>Priority: Major
>  Labels: memex
> Fix For: 1.9.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2019-04-01 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on AVRO-813:
--

Commit a5e0f4ad01703eb4a724e71dfcf99306819c6bf3 in avro's branch 
refs/heads/master from Daniel Kulp
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=a5e0f4a ]

[AVRO-813] Keep the InputStream contract of -1 for eof
Patch from Bruno Dumon applied


> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
>Priority: Major
>  Labels: memex
> Fix For: 1.9.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2015-11-02 Thread Ryan Blue (JIRA)

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

Ryan Blue commented on AVRO-813:


[~gcmcnutt], I don't think this issue applies to your current problem. Your 
problem appears to be that the connection was reset. That happens in your 
network stack rather than in Avro.

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
>  Labels: memex
> Fix For: 1.8.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2015-11-02 Thread Greg McNutt (JIRA)

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

Greg McNutt commented on AVRO-813:
--

I've run into a similar case:

- code that has been running just fine on windows and linux (aws) 
implementations for a year
- flipping over to an OSX dev environment and I quite often see these errors on 
receipt of a binary encoded response message.
- ONLY when client and server on same mac does this exception show up:
 windows <-> windows -- fine
 windows client <-> mac server -- fine
 mac client <-> windows server -- fine
 mac client <-> mac server -- fails around 25 % of the time

This trace shows the capture -- the returned byte stream and the avro portion 
look to be ok.  Any suggestions?  The ensureBounds(10) seems suspect.

---

2015-11-02T13:01:26.208-0800 [pool-1-thread-1] DEBUG httpclient.wire.content, 
principal=, sourceAddr=, - << 
"[0x2][0x16]avro.schema[0xb6][0x3]{"type":"record","name":"StoreWireResult","namespace":"com.guidewire.live.dataService.wire","fields":[{"name":"message","type":{"type":"string","avro.java.string":"String"}},{"name":"data","type":"bytes","default":""}]}[0x0][0xbd][0xea][0x81][0x86]C^[0xb2]/9[0xaa][0xea][0x8d][0xd2][0xc7]2[0xbf][0x2]h[0x4]ok`df/b7/3d/20/dfb73d20-b489-4e98-96b9-c428c1b49d48[0xbd][0xea][0x81][0x86]C^[0xb2]/9[0xaa][0xea][0x8d][0xd2][0xc7]2[0xbf]"
2015-11-02T13:12:19.226-0800 [pool-1-thread-1] DEBUG 
org.apache.commons.httpclient.HttpMethodBase, principal=, sourceAddr=, - Should 
close connection in response to directive: close
2015-11-02T13:12:19.227-0800 [pool-1-thread-1] DEBUG 
org.apache.commons.httpclient.HttpConnection, principal=, sourceAddr=, - 
Releasing connection back to connection manager.
2015-11-02T13:12:19.227-0800 [pool-1-thread-1] DEBUG 
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager, principal=, 
sourceAddr=, - Freeing connection, 
hostConfig=HostConfiguration[host=http://127.0.0.1:8098]
2015-11-02T13:12:19.227-0800 [pool-1-thread-1] DEBUG 
org.apache.commons.httpclient.util.IdleConnectionHandler, principal=, 
sourceAddr=, - Adding connection at: 1446498739227
2015-11-02T13:12:19.227-0800 [pool-1-thread-1] DEBUG 
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager, principal=, 
sourceAddr=, - Notifying no-one, there are no waiting threads
2015-11-02T13:12:19.227-0800 [pool-1-thread-1] WARN  
com.guidewire.live.dataService.services.RemoteDataServiceImpl, principal=, 
sourceAddr=, -  url=http://127.0.0.1:8098/data/store, retry=0
com.guidewire.live.dataService.DataServiceException: /data/store
at 
com.guidewire.live.dataService.services.RemoteDataServiceImpl.transportOperation(RemoteDataServiceImpl.java:160)
at 
com.guidewire.live.dataService.services.RemoteDataServiceImpl.storeWire(RemoteDataServiceImpl.java:84)
at 
com.guidewire.live.dataService.services.StoreAsyncService$StoreResultCallable.call(StoreAsyncService.java:267)
at 
com.guidewire.live.dataService.services.StoreAsyncService$StoreResultCallable.call(StoreAsyncService.java:236)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at 
org.apache.commons.httpclient.WireLogInputStream.read(WireLogInputStream.java:69)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at 
org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:108)
at 
org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw(BinaryDecoder.java:839)
at 
org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill(BinaryDecoder.java:692)
at org.apache.avro.io.BinaryDecoder.ensureBounds(BinaryDecoder.java:471)
at org.apache.avro.io.BinaryDecoder.readLong(BinaryDecoder.java:160)
at 
org.apache.avro.io.BinaryDecoder.doReadItemCount(BinaryDecoder.java:361)
at org.apache.avro.io.BinaryDecoder.readMapStart(BinaryDecoder.java:408)
at 
org.apache.avro.file.DataFileStream.initialize(DataFileStream.java:107)
at org.apache.avro.file.DataFileStream.(DataFileStream.java:84)
at 
com.guidewire.live.dataService.util.AvroSerde.fileStreamToObject(AvroSerde.java:80)
at 
com.guidewire.live.dataService.services.RemoteDataServiceImpl.transportOperation(RemoteDataServiceImpl.java:157)
... 7 more



> EOF

[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2015-09-16 Thread Lewis John McGibbney (JIRA)

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

Lewis John McGibbney commented on AVRO-813:
---

Hi [~rdblue], I found my issue. In my application I was not defining any 
particular serialzation definitions and was subsequently serializing the wrong 
data with the wrong code!

{code}

  io.serializations
org.apache.hadoop.io.serializer.WritableSerialization,org.apache.hadoop.io.serializer.JavaSerialization
  
  A list of serialization classes that can be used for
  obtaining serializers and deserializers.

{code}

Thanks for reply.

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
>  Labels: memex
> Fix For: 1.8.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2015-09-16 Thread Ryan Blue (JIRA)

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

Ryan Blue commented on AVRO-813:


[~lewismc], I think this issue is reporting the fact that an exception is 
thrown and caught in some circumstances internally. I've not see a case where 
that exception makes it up to the caller. If you're seeing an EOFException, it 
is probably a real one.

I've debugged this kind of thing before and it has always been a real 
EOFException, usually caused by files that have been cut short. If you can, I 
recommend checking the producer to ensure that the file writer is closed 
properly.

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
>  Labels: memex
> Fix For: 1.8.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2015-09-16 Thread Lewis John McGibbney (JIRA)

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

Lewis John McGibbney commented on AVRO-813:
---

BTW, the above was obtained using Nutch 2.3.1 HEAD, Gora 0.6.1, Avro 
1.9.0-SNAPSHOT (patched with the attached patch on this issue) and Hadoop 2.5.1.
I encounter it when I run a JUnit test in Nutch 2.3.1, so it can be very easily 
replicated.

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
>  Labels: memex
> Fix For: 1.8.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2015-09-16 Thread Lewis John McGibbney (JIRA)

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

Lewis John McGibbney commented on AVRO-813:
---

Can anyone confirm if the EOFException looks like the following?
{code}
Caused by: java.io.EOFException
at org.apache.avro.io.BinaryDecoder.ensureBounds(BinaryDecoder.java:473)
at org.apache.avro.io.BinaryDecoder.readInt(BinaryDecoder.java:128)
at org.apache.avro.io.BinaryDecoder.readIndex(BinaryDecoder.java:423)
at 
org.apache.avro.io.ResolvingDecoder.doAction(ResolvingDecoder.java:290)
at org.apache.avro.io.parsing.Parser.advance(Parser.java:88)
at 
org.apache.avro.io.ResolvingDecoder.readIndex(ResolvingDecoder.java:267)
at 
org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:178)
at 
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:152)
at 
org.apache.avro.generic.GenericDatumReader.readField(GenericDatumReader.java:240)
at 
org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:230)
at 
org.apache.avro.generic.GenericDatumReader.readWithoutConversion(GenericDatumReader.java:174)
at 
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:152)
at 
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:144)
at 
org.apache.hadoop.io.serializer.avro.AvroSerialization$AvroDeserializer.deserialize(AvroSerialization.java:127)
at 
org.apache.hadoop.mapreduce.task.ReduceContextImpl.nextKeyValue(ReduceContextImpl.java:146)
at 
org.apache.hadoop.mapreduce.task.ReduceContextImpl.nextKey(ReduceContextImpl.java:121)
at 
org.apache.hadoop.mapreduce.lib.reduce.WrappedReducer$Context.nextKey(WrappedReducer.java:302)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:170)
at 
org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:627)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:389)
at 
org.apache.hadoop.mapred.LocalJobRunner$Job$ReduceTaskRunnable.run(LocalJobRunner.java:319)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
{code}

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
>  Labels: memex
> Fix For: 1.8.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> Th

[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2015-03-24 Thread Huan Wang (JIRA)

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

Huan Wang commented on AVRO-813:


Hi Folks, I use Nutch 2.3 (Gora 0.6/ HBase 0.98.10.1/Avro 1.7.6) running 
'crawl' also appear this error.

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
>  Labels: memex
> Fix For: 1.8.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2014-09-26 Thread Doug Cutting (JIRA)

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

Doug Cutting commented on AVRO-813:
---

The patch looks reasonable to me and all existing tests pass.

We can note this as an incompatible change for Avro 1.8.

I'm happy to commit it if someone adds new tests that fail without this change. 
 

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
> Fix For: 1.8.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2014-09-25 Thread Viacheslav Dobromyslov (JIRA)

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

Viacheslav Dobromyslov commented on AVRO-813:
-

[~lewismc], yes. The patch helped.

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
>Assignee: Bruno Dumon
> Fix For: 1.8.0
>
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2014-09-24 Thread Lewis John McGibbney (JIRA)

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

Lewis John McGibbney commented on AVRO-813:
---

[~dobromyslov] can you please confirm if the patch attached here solves it for 
you?

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2014-09-24 Thread Viacheslav Dobromyslov (JIRA)

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

Viacheslav Dobromyslov commented on AVRO-813:
-

Same trouble with Nutch 2.3-SNAPSHOT, Gora 0.5, HBase 0.94.18, Hadoop 2.4.0.

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2014-09-13 Thread Lewis John McGibbney (JIRA)

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

Lewis John McGibbney commented on AVRO-813:
---

Hi Folks, it appears that applying the changes to Avro as per the patch 
attached here enables us to work with the stack of Nutch 2.3-SNAPSHOT (Gora 
0.4/ HBase 0.94.13/Avro 1.7.4) running against the HBase tables that were 
filled by Nutch 2.2.1 (Gora 0.3/ HBase 0.90.4/Avro 1.3.3).

Please see http://www.mail-archive.com/user%40nutch.apache.org/msg12660.html 
for more context on this one.

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2014-09-11 Thread Lewis John McGibbney (JIRA)

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

Lewis John McGibbney commented on AVRO-813:
---

I 'think' we've just run into this bug over on Gora when a user of Nutch 
upgraded Gora from 0.4 --> 0.5-SNAPSHOT (which we are about to release).
http://s.apache.org/nh7
I would like to get this fixed...
We are currently silently embracing this kind of Exception in the GoraMapper 
(which is also not good and we need to address this).

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-813) EOFException is thrown during normal operation

2011-04-27 Thread Scott Carey (JIRA)

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

Scott Carey commented on AVRO-813:
--

There is some trickiness due to some common InputStreams not quite implementing 
the contract correctly (Deflate/Gzip were troublesome IIRC).  The 
ensureBounds() contract is critical for performance, but how it is achieved is 
much less important.   I don't have time to have a deeper look at the moment 
but I believe there is room for improvement here.

> EOFException is thrown during normal operation
> --
>
> Key: AVRO-813
> URL: https://issues.apache.org/jira/browse/AVRO-813
> Project: Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.5.0
>Reporter: Bruno Dumon
> Attachments: avro-813-patch.txt
>
>
> In an application that uses Avro as RPC mechanism (with the NettyTransceiver, 
> but that's irrelevant), I've noticed in jprofiler that during normal 
> operation quite some time was spent creating EOFExceptions:
> {noformat}
>   5.4% - 2,004 ms org.apache.avro.ipc.generic.GenericResponder.readRequest
>   5.0% - 1,871 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.read
>   4.9% - 1,832 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.read
>   4.5% - 1,670 ms org.apache.avro.generic.GenericDatumReader.readRecord
>   4.3% - 1,596 ms org.apache.avro.generic.GenericDatumReader.read
>   2.8% - 1,048 ms org.apache.avro.generic.GenericDatumReader.readArray
>   1.3% - 477 ms org.apache.avro.io.ValidatingDecoder.arrayNext
>   1.3% - 471 ms org.apache.avro.io.BinaryDecoder.arrayNext
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.doReadItemCount
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.readLong
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder.ensureBounds
>   1.3% - 466 ms org.apache.avro.io.BinaryDecoder$ByteSource.compactAndFill
>   1.3% - 466 ms 
> org.apache.avro.io.BinaryDecoder$InputStreamByteSource.tryReadRaw
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.read
>   1.3% - 466 ms org.apache.avro.util.ByteBufferInputStream.getBuffer
>   1.3% - 466 ms java.io.EOFException.
>   1.3% - 466 ms java.io.IOException.
>   1.2% - 460 ms java.lang.Exception.
>   1.2% - 460 ms java.lang.Throwable.
>   1.2% - 460 ms java.lang.Throwable.fillInStackTrace
> {noformat}
> These exceptions are produced by the ByteBufferInputStream (which modifies 
> InputStream's contract: return -1 at eof), but are catched higher up by the 
> tryReadRaw method.
> What happens is this:
> The message in question has an (empty) array at the end of its message, thus 
> the reader tries to read the size of this array in BinaryDecoder.readLong. 
> This calls ensureBounds(10), whose contract is that it should read 10 bytes 
> if they are available, and otherwise be quiet. ensureBounds calls via 
> compactAndFill the tryReadRaw method. It is this method which catches the 
> EOFException, because it only 'tries' to read so many bytes.
> Note that InputStreamByteSource.readRaw (without the 'try' part) does itself 
> check if read < 0 in order to throw EOFException, making the throwing of 
> EOFException in ByteBufferInputStream unnecessary (for this particular usage).
> There was some talk about EOFException in AVRO-392 too, though it seems this 
> particular common case was not mentioned there. When using Avro RPC, or more 
> in general, when using Avro to read small messages rather than large files, 
> it seems like one can very easily run into this EOFException situation, which 
> hurts performance.
> I'll attach a patch which simply removes the throwing of EOFException in 
> ByteBufferInputStream, but this will likely break other cases which rely on 
> the EOFException being thrown (haven't researched this to the bottom).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira