Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed chunk writing if the data is bugger than our buffer (#251) #252

Merged
merged 1 commit into from
Sep 6, 2015

Conversation

zanker
Copy link
Contributor

@zanker zanker commented Sep 6, 2015

No description provided.

@zanker
Copy link
Contributor Author

zanker commented Sep 6, 2015

#251

cc @tarcieri @ixti @sferik

The failure mode for this is it either times out, or hangs forever. So apparently nobody has ran into this or has and hasn't reported it.

@tarcieri
Copy link
Member

tarcieri commented Sep 6, 2015

One related-looking test failure? (oh mocking IO...)

Would be nice if we had a better strategy for write buffering in general. I'm pretty sure we run afoul of the pathological case for Nagle where do a small write immediately followed by another write.

@zanker
Copy link
Contributor Author

zanker commented Sep 6, 2015

:( socket mocking. I want to redo the test suite somepoint and pull in the one we use for our internal stuff, since that has a lot of edge case handling already too.

Test failure should be fixed

@tarcieri
Copy link
Member

tarcieri commented Sep 6, 2015

LGTM 👍

tarcieri added a commit that referenced this pull request Sep 6, 2015
Fixed chunk writing if the data is bugger than our buffer (#251)
@tarcieri tarcieri merged commit ccdfdd1 into master Sep 6, 2015
@tarcieri tarcieri deleted the zanker/stress-tests branch September 6, 2015 21:44
while data.present?
length = @socket.write(data)
if data.length > length
data = data[length..-1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will allocate every time. I wonder if it would be possible to use #slice! here to reduce allocations. Or maybe we just need real ByteBuffers 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We call this using @body as is, so we probably can't use slice!, unless we call dup beforehand.

Would need to benchmark to figure out if the optimization works out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Ruby strings are CoW anyway, this usage is probably efficient

jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Oct 4, 2015
## 0.9.8 (2015-09-29)

* [#260](httprb/http#258):
  Fixed global timeout persisting time left across requests when reusing connections.
  ([@zanker][])

## 0.9.7 (2015-09-19)

* [#258](httprb/http#258):
  Unified strategy for handling exception-based and exceptionless non-blocking
  I/O. Fixes SSL support on JRuby 9000. ([@tarcieri][])


## 0.9.6 (2015-09-06)

* [#254](httprb/http#254):
  Removed use of an ActiveSupport specific method #present?
  ([@tarcieri][])


## 0.9.5 (2015-09-06)

* [#252](httprb/http#252):
  Fixed infinite hang/timeout when a request contained more than ~16,363 bytes.
  ([@zanker][])


## 0.9.4 (2015-08-26)

* Fixes regression when body streaming was failing on some URIs.
  See #246. (@zanker)
* Fixes require timeout statements. See #243. (@ixti)


## 0.9.3 (2015-08-19)

* Fixed request URI normalization. See #246. (@ixti)
  - Avoids query component normalization
  - Omits fragment component in headline


## 0.9.2 (2015-08-18)

* Fixed exceptionless NIO EOF handling. (@zanker)


## 0.9.1 (2015-08-14)

* Fix params special-chars escaping. See #246. (@ixti)


## 0.9.0 (2015-07-23)

* Support for caching removed. See #240. (@tarcieri)
* JRuby 9000 compatibility
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Nov 6, 2015
## 0.9.8 (2015-09-29)

* [#260](httprb/http#258):
  Fixed global timeout persisting time left across requests when reusing connections.
  ([@zanker][])

## 0.9.7 (2015-09-19)

* [#258](httprb/http#258):
  Unified strategy for handling exception-based and exceptionless non-blocking
  I/O. Fixes SSL support on JRuby 9000. ([@tarcieri][])


## 0.9.6 (2015-09-06)

* [#254](httprb/http#254):
  Removed use of an ActiveSupport specific method #present?
  ([@tarcieri][])


## 0.9.5 (2015-09-06)

* [#252](httprb/http#252):
  Fixed infinite hang/timeout when a request contained more than ~16,363 bytes.
  ([@zanker][])


## 0.9.4 (2015-08-26)

* Fixes regression when body streaming was failing on some URIs.
  See #246. (@zanker)
* Fixes require timeout statements. See #243. (@ixti)


## 0.9.3 (2015-08-19)

* Fixed request URI normalization. See #246. (@ixti)
  - Avoids query component normalization
  - Omits fragment component in headline


## 0.9.2 (2015-08-18)

* Fixed exceptionless NIO EOF handling. (@zanker)


## 0.9.1 (2015-08-14)

* Fix params special-chars escaping. See #246. (@ixti)


## 0.9.0 (2015-07-23)

* Support for caching removed. See #240. (@tarcieri)
* JRuby 9000 compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants