Git Product home page Git Product logo

Comments (3)

headius avatar headius commented on July 30, 2024

The relevant bit of the JVM exception trace from JRuby is shown below:

java.nio.BufferOverflowException
	at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:189)
	at org.jruby.util.IOChannel.read(IOChannel.java:93)
	at org.jruby.util.IOChannel$IOReadableByteChannel.read(IOChannel.java:151)
	at org.jruby.RubyIO.transfer(RubyIO.java:4454)
	at org.jruby.RubyIO.copy_stream(RubyIO.java:4345)
	at org.jruby.RubyIO$INVOKER$s$0$2$copy_stream.call(RubyIO$INVOKER$s$0$2$copy_stream.gen)
	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:819)
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:211)
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
	at Users.headius.projects.jruby.lib.ruby.stdlib.net.http.generic_request.invokeOther21:copy_stream(/Users/headius/projects/jruby/lib/ruby/stdlib/net/http/generic_request.rb:212)
...

Because readpartial returned more data than requested, we are forced to raise an error from our IOReadableByteChannel (which wraps an IO-like object with a JVM IO Channel) since there's simply nowhere in the buffer to put it.

https://github.com/jruby/jruby/blob/30e9fa45cc13e97767c64d18410af8547c10ff5d/core/src/main/java/org/jruby/util/IOChannel.java#L86-L95

from webrick.

headius avatar headius commented on July 30, 2024

FWIW the new error that JRuby will raise in this case:

(IOError) error calling WEBrick::HTTPRequest#readpartial: requested 8192 but received 65536

This error ends up getting swallowed by net/http plumbing, but the result is the same.

from webrick.

headius avatar headius commented on July 30, 2024

The change in #45 does appear to fix this issue.

from webrick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.