Skip to content

Commit

Permalink
Fix cuncurrent channel error (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsafMah authored Aug 31, 2023
1 parent d81c8b6 commit 6817075
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
23 changes: 17 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,39 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Fixed

- Fixed deadlock when having high number of concurrent queries

## [0.14.0] - 2023-08-10

### Added

- Support streaming for blob, for Managed client as well.
- Support more urls for kusto, including http and port.

### Fixed
* Fixed wrong context deadline setting
* Fixed accepting empty url.


* Fixed wrong context deadline setting
* Fixed accepting empty url.

## [0.13.1] - 2023-05-24

### Changed

- Modified `once.go` to reset `sync.Once` instance when an error occurs

## [0.13.0] - 2023-05-09

### Added

- `ServerTimeout` Query Option
- The timeout to the server will be set to the value of this option, or to none if `RequestNoTimeout` is set to true.
- If it is not provided, the timeout will be set by the context (the old behaviour).
- If a context timeout is not provided, it will fall back to a default value by the type of request.
- The timeout to the server will be set to the value of this option, or to none if `RequestNoTimeout` is set to
true.
- If it is not provided, the timeout will be set by the context (the old behaviour).
- If a context timeout is not provided, it will fall back to a default value by the type of request.
- Support for `IgnoreFirstRecord` ingestion option

### Changed
Expand Down
20 changes: 12 additions & 8 deletions kusto/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,19 @@ func newRowIterator(ctx context.Context, cancel context.CancelFunc, execResp exe
RequestHeader: execResp.reqHeader,
ResponseHeader: execResp.respHeader,

op: op,
ctx: ctx,
cancel: cancel,
progressive: header.IsProgressive,
inColumns: make(chan send, 1),
op: op,
ctx: ctx,
cancel: cancel,
progressive: header.IsProgressive,
// There could be a case where the rows channel fires before the columns channel
// So now the rows channel assumes the columns have been recieved, but the loop on the other side is blocked.
// Raising the buffer size solves this issue in practice - since inColumns never has to wait, it always compeletes first.
// This isn't a perfect solution, but this code is going to be discarded for v2 anyway.
inColumns: make(chan send, 5),
inRows: make(chan send, 100),
inProgress: make(chan send, 1),
inNonPrimary: make(chan send, 1),
inCompletion: make(chan send, 1),
inProgress: make(chan send, 5),
inNonPrimary: make(chan send, 5),
inCompletion: make(chan send, 5),
inErr: make(chan send),

rows: make(chan Row, 1000),
Expand Down

0 comments on commit 6817075

Please sign in to comment.