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

http2: verify that flooding error happens #17969

Closed
wants to merge 1 commit into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Jan 3, 2018

verify protections against ping and settings flooding

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

http2

@jasnell jasnell added http2 Issues or PRs related to the http2 subsystem. test Issues and PRs related to the tests. labels Jan 3, 2018
@jasnell
Copy link
Member Author

jasnell commented Jan 3, 2018

ping @nodejs/http2

@jasnell jasnell force-pushed the http2-verifyflooding branch from 3aef309 to 0667401 Compare January 3, 2018 22:40
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@jasnell
Copy link
Member Author

jasnell commented Jan 5, 2018

@jasnell jasnell force-pushed the http2-verifyflooding branch from 0667401 to a881ade Compare January 5, 2018 21:14
@jasnell
Copy link
Member Author

jasnell commented Jan 5, 2018

Seeing some flakiness across platforms. The reason appears to be:

  1. Some platforms respond to pings/settings at different rates therefore making the exact timing of a ping/settings flood error a bit difficult to predict. Hopefully writing them at a faster pace will ensure we hit it on all platforms.

  2. There is some variance on windows in the timing of the ECONNRESET error that I'm still tracking down.

New CI: https://ci.nodejs.org/job/node-test-pull-request/12428/

@jasnell
Copy link
Member Author

jasnell commented Jan 5, 2018

Still flaky... trying again: https://ci.nodejs.org/job/node-test-pull-request/12430/

@jasnell
Copy link
Member Author

jasnell commented Jan 5, 2018

Trying once again... https://ci.nodejs.org/job/node-test-pull-request/12431/

It's entirely possible that we won't be able to reliable test for ping and settings flood generically on all systems. In which case, I will move the tests out of parallel and have to mark them flaky

@jasnell
Copy link
Member Author

jasnell commented Jan 6, 2018

So close... but still seeing flakiness on the flood tests on Windows. Moved to sequential and marked flaky. Those are going to be generally unreliable as a rule due to the nature of the error and the code that triggers it. We need the coverage either way but will have to investigate some way of making them less flaky later.

@jasnell
Copy link
Member Author

jasnell commented Jan 6, 2018

@jasnell jasnell force-pushed the http2-verifyflooding branch 2 times, most recently from 77e97cc to 4ca203c Compare January 6, 2018 00:46
@jasnell
Copy link
Member Author

jasnell commented Jan 6, 2018

@mcollina ... can you take one more look at this.

});
}));

client.on('error', () => {});
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer this to be a proper a common.mustCall() with an error check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Whether or not an error happens here is dependent entirely on operating system. It's quite flaky.

client.write(kSettings.data, () => {
// Give time to receive the servers settings frame
// so that the first ack below is actually expected.
setImmediate(() => {
Copy link
Member

Choose a reason for hiding this comment

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

I fear this might be time sensitive. Can we avoid it anyhow? Maybe add a comment here

Copy link
Member Author

Choose a reason for hiding this comment

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

We can with a bit of dancing between the client and server. Will take another pass.

Copy link
Member Author

Choose a reason for hiding this comment

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

actually, no dancing required. pretty straight forward :-)

}));

// We don't care if an error is emitted here, but don't crash
client.on('error', () => {});
Copy link
Member

Choose a reason for hiding this comment

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

can you make this a proper function?

Copy link
Member Author

Choose a reason for hiding this comment

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

In which sense? client.on('error', function() {}) ? I can, but I'm curious about why it matters in this case.

Copy link
Member

Choose a reason for hiding this comment

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

I mean, handling/checking the error, you answered on another file. Why don't you put a note about the fact that the error can or cannot happen depending on the OS?

Copy link
Member Author

Choose a reason for hiding this comment

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

Already done :-)

}));

// We don't care if an error is emitted here, but don't crash
client.on('error', () => {});
Copy link
Member

Choose a reason for hiding this comment

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

can you make this a proper function?

@jasnell
Copy link
Member Author

jasnell commented Jan 8, 2018

New CI before landing: https://ci.nodejs.org/job/node-test-pull-request/12444/

@jasnell jasnell force-pushed the http2-verifyflooding branch from ad66c46 to de9a99a Compare January 8, 2018 19:06
@jasnell
Copy link
Member Author

jasnell commented Jan 8, 2018

New CI: https://ci.nodejs.org/job/node-test-pull-request/12445/
Had to adjust a couple of the tests because of another PR that landed

@jasnell
Copy link
Member Author

jasnell commented Jan 8, 2018

Once more... with feeling https://ci.nodejs.org/job/node-test-pull-request/12446/

* verify protections against ping and settings flooding
* Strictly handle and verify handling of unsolicited ping and
  settings frame acks.
@jasnell jasnell force-pushed the http2-verifyflooding branch from 3bd5cb0 to c8287db Compare January 8, 2018 21:09
@jasnell
Copy link
Member Author

jasnell commented Jan 8, 2018

CI is good

jasnell added a commit that referenced this pull request Jan 8, 2018
* verify protections against ping and settings flooding
* Strictly handle and verify handling of unsolicited ping and
  settings frame acks.

PR-URL: #17969
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@jasnell
Copy link
Member Author

jasnell commented Jan 8, 2018

Landed in 3303987

@jasnell jasnell closed this Jan 8, 2018
MylesBorins pushed a commit to jasnell/node that referenced this pull request Jan 9, 2018
* verify protections against ping and settings flooding
* Strictly handle and verify handling of unsolicited ping and
  settings frame acks.

PR-URL: nodejs#17969
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
* verify protections against ping and settings flooding
* Strictly handle and verify handling of unsolicited ping and
  settings frame acks.

Backport-PR-URL: #18050
PR-URL: #17969
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jan 10, 2018
MylesBorins pushed a commit that referenced this pull request Jan 10, 2018
* verify protections against ping and settings flooding
* Strictly handle and verify handling of unsolicited ping and
  settings frame acks.

Backport-PR-URL: #18050
PR-URL: #17969
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@Trott
Copy link
Member

Trott commented Jan 10, 2018

Can we revert this until the test doesn't fail all the time on Windows?

@Trott
Copy link
Member

Trott commented Jan 10, 2018

(If the problem is Windows and not the code here, then the solution is probably not to mark the test as flaky but to not bother running the test on Windows at all. Skip it instead. There is no point in running a test if the results are meaningless.)

@jasnell
Copy link
Member Author

jasnell commented Jan 10, 2018

I'm good with skipping on windows for now. Just want to make sure we can revisit this.

@Trott
Copy link
Member

Trott commented Jan 10, 2018

Maybe skip on Windows and open an issue in the issue tracker about how it probably could be made to work on Windows and put as much info there as you can?

@jasnell
Copy link
Member Author

jasnell commented Jan 10, 2018

I'll (1) open a PR that skips on windows, (2) add a known-issue test that skips everything but windows, and (3) open an issue that discusses it. The key thing to remember here is that the failure is not an actual failure, the code is working as it is supposed to on Windows, the test just does not have the ability to trigger the error condition on Windows.

kjin pushed a commit to kjin/node that referenced this pull request May 1, 2018
* verify protections against ping and settings flooding
* Strictly handle and verify handling of unsolicited ping and
  settings frame acks.

Backport-PR-URL: nodejs#18050
PR-URL: nodejs#17969
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 2, 2018
* verify protections against ping and settings flooding
* Strictly handle and verify handling of unsolicited ping and
  settings frame acks.

Backport-PR-URL: #18050
Backport-PR-URL: #20456
PR-URL: #17969
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@MylesBorins MylesBorins mentioned this pull request May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http2 Issues or PRs related to the http2 subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants