question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

race condition in http/2 around connection preface

See original GitHub issue

Expected behavior

h2 clients should buffer messages until after the connection preface has been sent

Actual behavior

h2 will try to write http/2 frames before writing the connection preface.

Steps to reproduce

Construct a netty pipeline, add an http2connectionhandler, call connect, then immediately try writing an http/2 message.

Minimal yet complete reproducer code (or URL to code)

Remove this line: https://github.com/twitter/finagle/blob/develop/finagle-http2/src/main/scala/com/twitter/finagle/http2/Http2Transporter.scala#L113 and then try running our test suite.

https://github.com/twitter/finagle

Netty version

4.1.7 (goes back as far as 4.1.0, I think)

JVM version (e.g. java -version)

8

OS version (e.g. uname -a)

Darwin tw-172-25-138-25.office.twttr.net 14.5.0 Darwin Kernel Version 14.5.0: Sun Sep 25 22:07:15 PDT 2016; root:xnu-2782.50.9~1/RELEASE_X86_64 x86_64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
mosesncommented, Jan 27, 2017

OK, this isn’t high priority for us, since we have something working, but I’ll see if I can schedule some time for a PR for this.

1reaction
mosesncommented, Jan 25, 2017

@Scottmitch I almost forgot–the reason I filed this ticket was because I found that it wasn’t always triggered on channelActive, so right now I have to try to guess when the preface will be sent. As an example, if I’m using ALPN to decide whether to install the http/2 connection handler or not, when I add the handler, channelActive has already been triggered, so instead it sends the connection preface on handlerAdded. This means I need a different buffering handler depending upon how it’s added to the pipeline.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Possible race condition with http2 · Issue #2469 · square/okhttp
It looks like the server is sending the SETTINGS frame before we have time to send the connection preface. We ACK the settings...
Read more >
Exploiting Race Conditions in Web Applications ... - NTNU Open
Race conditions can occur in web applications if several threads, ... parallel requests over a single TCP connection, making race condition.
Read more >
Possible race condition With http2 implementation
I have a curious issue, which happens in production very infrequently. I have a gobal http client to reuse connections.
Read more >
Race Condition in Web Applications - Wallarm
The race condition occurs both in multithreaded applications and in the databases in which they work. Read all the details in our article....
Read more >
What is a Race Condition? - TechTarget
In a network, a race condition may occur if two users try to access a channel at the same instant and neither computer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found