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

Several updates to refresh spdy-transport #61

Merged
merged 8 commits into from
Nov 8, 2018

Conversation

jacobheun
Copy link
Contributor

@jacobheun jacobheun commented Nov 6, 2018

This PR does a few things (I can break the work out to separate PRs as needed) to start getting spdy-transport in a better spot for maintenance. There are still more things that are needed, but this should help us get started down that road.

  • All dependencies have been updated
  • Safe Buffer has been dropped as it should no longer be needed
  • Linting has been fixed to comply with the latest version of standard
  • Deprecation warnings have been fixed for asserts and Buffer usages
  • Includes PRs Don't automatically send push response headers if disabled #50 and Fix memory leak when removing nodes #48. I can rebase once those are merged.
  • No longer overriding stream.destroy as this is bad practice. Instead _destroy will call abort when the inherited destroy is called.
  • Wrapping bad stream.push behavior in a try catch for now. All stream usage needs to be checked for complying with stream best practices. Per Scheduler does not obey Stream.push api #60, Scheduler doesn't properly handle backpressure. It will need an overhaul, but should be done as it's own PR.
  • Updates Travis to test on node LTS versions (currently 6, 8, 10) and stable (11)

fix: remove safe-buffer

* fix lint for latest standard
* fix tests that broke in the dependency update
* update deprecated assertions to the recommended methods
@daviddias
Copy link
Member

Hi @jacobheun, exceptional work, thank you so much for pushing this.

Have you tested this with node-spdy?

It seems that this upgrade requires to drop any Node.js version below 4. I am comfortable with that as those versions have left the LTS cycle for multiple years now.

@@ -121,7 +121,13 @@ Scheduler.prototype.tickSync = function tickSync () {
debug('tick sync pending=%d', this.count, item.chunks)
for (var j = 0; j < item.chunks.length; j++) {
this.count--
res = this.push(item.chunks[j])
// TODO: handle stream backoff properly
Copy link
Member

Choose a reason for hiding this comment

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

What does properly mean in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now we could be iterating over n+1 chunks. If the nth chunk causes this.push to return false, we're still going to try and push another chunk. This will cause an error and violates back pressure design in the streams api. As soon as false is returned we need to respect that and wait for _read to get called again. I tried some other "quick fix" options, but it caused issues elsewhere. I need to spend more time getting up to speed on the transport to do a proper audit and refactor of the stream extensions.

@jacobheun
Copy link
Contributor Author

@diasdavid ah right, I have not! I'll do that now and prep any PRs needed there.

luma added a commit to autopilothq/node-spdy that referenced this pull request Nov 7, 2018
**What?**

Point to the fixed version of spdy-transport from spdy-http2/spdy-transport#61.

**Why?**

Because ths breaks use of webpack-dev-server and we're
aren't sure when the PRs will be merged.
luma added a commit to autopilothq/node-spdy that referenced this pull request Nov 7, 2018
**What?**

Grab the spdy-transport fixes from spdy-http2/spdy-transport#61

**Why?**

Because problems in spdy-transport have broken webpack-dev-server
and there's no timeline for the fixes to be merged.
luma added a commit to autopilothq/webpack-dev-server that referenced this pull request Nov 7, 2018
**What?**

Grab the spdy-transport fixes from spdy-http2/spdy-transport#61

**Why?**

Because problems in spdy-transport have broken webpack-dev-server
and there's no timeline for the fixes to be merged.
@jacobheun
Copy link
Contributor Author

@diasdavid I've got a PR open for node-spdy spdy-http2/node-spdy#351. It doesn't require any changes here and shows this working on the node LTS versions. There is an issue with node 11.1.0 due to internal stream changes, but I think that can be revisited as those changes stabilize.

@daviddias daviddias merged commit 3b3f534 into spdy-http2:master Nov 8, 2018
@vytautas-pranskunas-
Copy link

When we can expect for updated spdy package?

@daviddias
Copy link
Member

@vytautas-pranskunas- spdy-http2/node-spdy#351 right now :)

@daviddias
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants