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

Limit pool size #2019

Merged
merged 2 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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