Skip to content

Commit

Permalink
Limit pool size (#2019)
Browse files Browse the repository at this point in the history
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
  • Loading branch information
ntkme and nex3 committed Jun 15, 2023
1 parent e34a0c7 commit b11840e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
## 1.63.5

### Embedded Sass

* Fix a deadlock when running at high concurrency on 32-bit systems.

## 1.63.4

### JavaScript API
Expand Down
8 changes: 5 additions & 3 deletions lib/src/embedded/isolate_dispatcher.dart
Expand Up @@ -3,6 +3,7 @@
// https://opensource.org/licenses/MIT.

import 'dart:async';
import 'dart:ffi';
import 'dart:io';
import 'dart:isolate';
import 'dart:typed_data';
Expand Down Expand Up @@ -51,9 +52,10 @@ class IsolateDispatcher {
/// A pool controlling how many isolates (and thus concurrent compilations)
/// may be live at once.
///
/// More than 15 concurrent `waitFor()` calls seems to deadlock the Dart VM,
/// even across isolates. See sass/dart-sass#1959.
final _isolatePool = Pool(15);
/// More than MaxMutatorThreadCount isolates in the same isolate group
/// can deadlock the Dart VM.
/// See https://github.com/sass/dart-sass/pull/2019
final _isolatePool = Pool(sizeOf<IntPtr>() <= 4 ? 7 : 15);

/// Whether the underlying channel has closed and the dispatcher is shutting
/// down.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,5 +1,5 @@
name: sass
version: 1.63.4
version: 1.63.5-dev
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit b11840e

Please sign in to comment.