Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Issue 2791423002: [dart:io] Don't close stdin with a socket finalizer (Closed)

Created:
3 years, 8 months ago by zra
Modified:
3 years, 8 months ago
Reviewers:
rmacnak, siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[dart:io] Don't close stdin with a socket finalizer If an Isolate touches the 'stdio' getter, a _NativeSocket with attached finalizer is created for it. Previously, when such an Isolate exited, the finalizer would close the underlying file descriptor. This CL changes the finalizer for stdin such that the native objects will be cleaned up, but the underlying file descriptor will not be closed. The underlying file descriptor will now only be closed if the stdin stream subscription is explicitly canceled. Accessing the stdin getter after the stream is explicitly canceled will result in a FileSystemException. See also: https://github.com/dart-lang/test/issues/583 fixes #29229 R=rmacnak@google.com Committed: https://github.com/dart-lang/sdk/commit/8c9c54d833865201abdaadbfa25c0c17b07d9926

Patch Set 1 #

Patch Set 2 : Windows fixes #

Patch Set 3 : Windows 7 fix #

Total comments: 2

Patch Set 4 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -65 lines) Patch
M runtime/bin/eventhandler_win.h View 1 2 chunks +16 lines, -7 lines 0 comments Download
M runtime/bin/eventhandler_win.cc View 1 2 5 chunks +42 lines, -14 lines 0 comments Download
M runtime/bin/file_android.cc View 1 chunk +1 line, -4 lines 0 comments Download
M runtime/bin/file_fuchsia.cc View 1 chunk +1 line, -4 lines 0 comments Download
M runtime/bin/file_linux.cc View 1 chunk +1 line, -4 lines 0 comments Download
M runtime/bin/file_macos.cc View 1 chunk +1 line, -4 lines 0 comments Download
M runtime/bin/process.cc View 1 chunk +8 lines, -4 lines 0 comments Download
M runtime/bin/socket.h View 2 chunks +8 lines, -2 lines 0 comments Download
M runtime/bin/socket.cc View 10 chunks +45 lines, -19 lines 0 comments Download
M runtime/bin/socket_win.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M runtime/bin/stdio_patch.dart View 2 chunks +4 lines, -2 lines 0 comments Download
M runtime/platform/globals.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A tests/standalone/io/stdio_socket_finalizer_test.dart View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (5 generated)
zra
3 years, 8 months ago (2017-04-03 21:18:03 UTC) #3
rmacnak
lgtm https://codereview.chromium.org/2791423002/diff/40001/tests/standalone/io/stdio_socket_finalizer_test.dart File tests/standalone/io/stdio_socket_finalizer_test.dart (right): https://codereview.chromium.org/2791423002/diff/40001/tests/standalone/io/stdio_socket_finalizer_test.dart#newcode22 tests/standalone/io/stdio_socket_finalizer_test.dart:22: ReceivePort errorPort = new ReceivePort(); Dead
3 years, 8 months ago (2017-04-04 20:34:46 UTC) #6
zra
https://codereview.chromium.org/2791423002/diff/40001/tests/standalone/io/stdio_socket_finalizer_test.dart File tests/standalone/io/stdio_socket_finalizer_test.dart (right): https://codereview.chromium.org/2791423002/diff/40001/tests/standalone/io/stdio_socket_finalizer_test.dart#newcode22 tests/standalone/io/stdio_socket_finalizer_test.dart:22: ReceivePort errorPort = new ReceivePort(); On 2017/04/04 20:34:46, rmacnak ...
3 years, 8 months ago (2017-04-04 20:50:39 UTC) #7
zra
3 years, 8 months ago (2017-04-04 20:57:48 UTC) #9
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
8c9c54d833865201abdaadbfa25c0c17b07d9926 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698