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

Unroll defers and remove breaks. #440

Merged
merged 4 commits into from
Aug 9, 2023
Merged

Unroll defers and remove breaks. #440

merged 4 commits into from
Aug 9, 2023

Conversation

cheatfate
Copy link
Collaborator

No description provided.

…cts.

Add request query to debug information.
Add test for query debug string.
@@ -813,6 +823,7 @@ proc closeUnsecureConnection(conn: HttpConnectionRef) {.async.} =
except CancelledError:
await allFutures(pending)
untrackCounter(HttpServerUnsecureConnectionTrackerName)
conn[].clean()
Copy link
Member

Choose a reason for hiding this comment

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

reset(conn[]) does the same and is part of system

@arnetheduck
Copy link
Member

generally, I think #418 is a better general-purpose fix. The problem with defer and finally is that we don't run the iterator to completion so not all code is run - this is the same problem as below, without a closure iterator transformation:

iterator x(): int {.closure.} =
  yield 42
  echo "hello"

proc works() =
   var z = x
   for a in z():
     echo a

proc broken() =
  var z = x

  for a in z():
    echo a
    break

works()
broken()

@cheatfate
Copy link
Collaborator Author

So should i wait for #418 to become ready or we are looking for leaks right now?

@cheatfate cheatfate merged commit 6c2ea67 into master Aug 9, 2023
12 checks passed
@cheatfate cheatfate deleted the unpack-finally branch August 9, 2023 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants