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.

Undeprecate `ctx.setRequest/ResponseTimeout()`?

See original GitHub issue

We got some internal inquiry about what should a user do instead of ServiceRequestContext.setRequestTimeoutMillis(long). IIUC the current API, it has to be:

final requestStartTimeMillis = 
    ctx.log().ensureAvailable(RequestLogProperty.REQUEST_START_TIME)
             .requestStartTimeMillis();
ctx.setRequestTimeoutAt(Instant.ofEpochMillis(requestStartTimeMillis + timeout);

… which is not ideal.

On the other hand, I found a bug where the current setRequestTimeoutMillis() implementation uses extendRequestTimeout(), which means the timeout will not be set when there’s no timeout scheduled yet.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
anuraagacommented, Feb 26, 2020

Sorry for accidentally closing issue >< On mobile it’s just one mistouch when wanting to scroll the page.

0reactions
anuraagacommented, Mar 3, 2020

For some reason I can’t come to love this enum, but I guess it’s ok. It’s probably just preference towards deadline than timeouts which is a long sailed ship.

I think making this enum consistently from helps it a lot if possible. Maybe this

enum TimeoutAdjustment {
  /** Sets a timeout to be a given amount of time from the current time as returned by {@link System#nanoTime}. */
  NOW,

  /** Sets a timeout to be a given amount of time from when the current request began processing. */
  START,

  /** Sets a timeout to be a given amount of time from the end of the currently set timeout. */
  CURRENT // Or CURRENT_END?
  ;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Koa - set timeout on incoming requests - Stack Overflow
server.timeout = config.PROCESSING_TIMEOUT;. A timeout can be specified in a specific request for Koa as follows ctx.request.socket.
Read more >
The complete guide to Go net/http timeouts
ReadTimeout covers the time from when the connection is accepted to when the request body is fully read (if you do read the...
Read more >
XMLHttpRequest.timeout - Web APIs | MDN
The XMLHttpRequest.timeout property is an unsigned long representing the number of milliseconds a request can take before automatically ...
Read more >
gocql - Go Packages - The Go Programming Language
Package gocql implements a fast and robust Cassandra driver for the Go programming language. Connecting to the cluster ¶. Pass a list of...
Read more >
Actions - Progressive microservices framework for Node.js
It has request parameters & returns response, like a HTTP request. ... this.actions.xy() ) you should set parentCtx to pass meta data.
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