Skip to content

Commit b11840e

Browse files
ntkmenex3
andauthored
Limit pool size (#2019)
Co-authored-by: Natalie Weizenbaum <[email protected]>
1 parent e34a0c7 commit b11840e

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.63.5
2+
3+
### Embedded Sass
4+
5+
* Fix a deadlock when running at high concurrency on 32-bit systems.
6+
17
## 1.63.4
28

39
### JavaScript API

lib/src/embedded/isolate_dispatcher.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// https://opensource.org/licenses/MIT.
44

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

5860
/// Whether the underlying channel has closed and the dispatcher is shutting
5961
/// down.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.63.4
2+
version: 1.63.5-dev
33
description: A Sass implementation in Dart.
44
homepage: https://github.com/sass/dart-sass
55

0 commit comments

Comments
 (0)