-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implements pending future tracking in async. #11181
Conversation
|
||
var futuresInProgress {.threadvar.}: Table[FutureInfo, int] | ||
|
||
proc getFuturesInProgress*(): var Table[FutureInfo, int] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole proc is not necessary with the new table implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest it's probably better to have this proc anyway. Accessing a global var doesn't seem like great API design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What? The proc is exported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use a TableRef then with this logic, this var Table
here is fragile :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, can you explain why it is fragile?
baa155d
to
1805947
Compare
Windows test failure is unrelated to PR. https://ci.appveyor.com/project/dom96/nim/builds/24332702/job/dtt16wof6xkd7qjx#L1407 |
1805947
to
abe634a
Compare
Is it really so risky to merge this that you need to keep retrying the CI until it passes? |
Thanks @Araq <3 |
This is incredibly useful for figuring out possible leaks caused by stuck async procs/futures.
Here is an example from my server during a leak:
You can see some counts at 6k+. Normally they are all 0 or
1
. I will also be adding support for this in my prometheus package which will make analysing this an absolute dream