Skip to content

Commit

Permalink
Fix tail recursion leak (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink authored Jun 10, 2019
1 parent 5165b52 commit f8a355e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ The `Unreleased` section name is replaced by the expected version of next releas

### Fixed

- remove leak due to incorrect tail-recursion (`do!` -> `return!`) [#39](https://github.com/jet/Jet.ConfluentKafka.FSharp/pull/39)

<a name="1.0.1-rc1"></a>

## [1.0.1-rc1] - 2019-06-03

### Added
Expand All @@ -28,6 +31,13 @@ The `Unreleased` section name is replaced by the expected version of next releas

- Targets `Confluent.Kafka` v `1.0.1`, `librdkafka.redist` v `1.0.1`

<a name="1.0.0-rc14"></a>
## [1.0.0-rc14] - 2019-06-10

### Fixed

- remove leak due to incorrect tail-recursion (`do!` -> `return!`) (Cherry pick of [#39](https://github.com/jet/Jet.ConfluentKafka.FSharp/pull/39))

<a name="1.0.0-rc13"></a>
## [1.0.0-rc13] - 2019-06-01

Expand Down Expand Up @@ -178,6 +188,7 @@ The `Unreleased` section name is replaced by the expected version of next releas

[Unreleased]: https://github.com/jet/Jet.ConfluentKafka.FSharp/compare/1.0.1-rc1...HEAD
[1.0.1-rc1]: https://github.com/jet/Jet.ConfluentKafka.FSharp/compare/1.0.0-rc13...1.0.1-rc1
[1.0.0-rc14]: https://github.com/jet/Jet.ConfluentKafka.FSharp/compare/1.0.0-rc13...1.0.0-rc14
[1.0.0-rc13]: https://github.com/jet/Jet.ConfluentKafka.FSharp/compare/1.0.0-rc12...1.0.0-rc13
[1.0.0-rc12]: https://github.com/jet/Jet.ConfluentKafka.FSharp/compare/1.0.0-rc11...1.0.0-rc12
[1.0.0-rc11]: https://github.com/jet/Jet.ConfluentKafka.FSharp/compare/1.0.0-rc10...1.0.0-rc11
Expand Down
6 changes: 3 additions & 3 deletions src/Jet.ConfluentKafka.FSharp/ConfluentKafka.fs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ module private ConsumerImpl =
with e ->
tcs.TrySetException e |> ignore
cts.Cancel()
do! loop() }
return! loop() }

Async.Start(loop(), cts.Token)

Expand All @@ -403,9 +403,9 @@ module private ConsumerImpl =
| :? System.OperationCanceledException -> log.Warning("Consuming... cancelled {name}", consumer.Name)
finally
consumer.Close()

// await for handler faults or external cancellation
do! Async.AwaitTaskCorrect tcs.Task
return! Async.AwaitTaskCorrect tcs.Task
}

/// Creates and wraps a Confluent.Kafka IConsumer, wrapping it to afford a batched consumption mode with implicit offset progression at the end of each
Expand Down

0 comments on commit f8a355e

Please sign in to comment.