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

HTTP/3, curl_ngtcp2, using ever increasing timestamp in io #11288

Closed
wants to merge 4 commits into from

Conversation

icing
Copy link
Contributor

@icing icing commented Jun 9, 2023

  • ngtcp2 v0.16.0 asserts that timestamps passed to its function
    will only ever increase.
  • Use a context shared between ingress/egress operations that
    uses a shared timestamp, regularly updated during calls.
  • based on ngtcp2: build with 0.16.0 and nghttp3 0.12.0 #11184 that switched ngtcp2 and family version numbers

bagder and others added 4 commits June 7, 2023 13:58
- moved to qlog_write
- crypto => encryption
- CRYPTO => ENCRYPTION
- removed "_is_"
- ngtcp2_conn_shutdown_stream_read and
  ngtcp2_conn_shutdown_stream_write got flag arguments
- the nghttp3_callbacks struct got a recv_settings callback
- nghttp3 0.12.0
- ngtcp2 v0.16.0 asserts that timestamps passed to its function
  will only ever increase.
- Use a context shared between ingress/egress operations that
  uses a shared timestamp, regularly updated during calls.
- based on curl#11184 that switched ngtcp2 and family version numbers
@github-actions github-actions bot added the CI Continuous Integration label Jun 9, 2023

static ngtcp2_tstamp timestamp(void)
{
struct curltime ct = Curl_now();
Copy link

Choose a reason for hiding this comment

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

Curl_now() isn't guaranteed to always go forwards, in some situations it can jump back. For most modern platforms it is monotonic, however.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The addition is a move, since the function is needed earlier in the code.

What is the alternative? Any recommendation?

Copy link

Choose a reason for hiding this comment

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

Unfortunately guaranteed monotonic clock adds platform dependency. There is no fully portable and widely available way to get truly monotonic clock.

Traditionally clock_gettime(CLOCK_MONOTONIC, ..) had been considered to be only increasing time stamp. However, for example macOS CLOCK_MONOTONIC isn't always monotonic and can actually jump back.

Depending on what is needed CLOCK_MONOTONIC_RAW might be suitable. This of course isn't available generally everywhere.

bagder added a commit that referenced this pull request Jun 9, 2023
Reported-by: Harry Sintonen
Ref: #11288
@bagder
Copy link
Member

bagder commented Jun 9, 2023

We can merge this and work on the clock independently, I created #11291

@bagder bagder closed this in 3f78498 Jun 9, 2023
bagder added a commit that referenced this pull request Jun 12, 2023
Reported-by: Harry Sintonen
Ref: #11288
Closes #11291
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
- ngtcp2 v0.16.0 asserts that timestamps passed to its function
  will only ever increase.
- Use a context shared between ingress/egress operations that
  uses a shared timestamp, regularly updated during calls.

Closes curl#11288
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
- ngtcp2 v0.16.0 asserts that timestamps passed to its function
  will only ever increase.
- Use a context shared between ingress/egress operations that
  uses a shared timestamp, regularly updated during calls.

Closes curl#11288
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration
Development

Successfully merging this pull request may close these issues.

None yet

4 participants