-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Bad state: Future already completed #45047
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
Comments
This might be related to DNS resolution changes /cc @aam |
DNS resolution change(looking up ipv4 and ipv6 in parallel) targeted osx, should not have affected other os. @bsutton how easy is to reproduce the failure? Are you issuing |
Dswitch just creates a sym link to the SDK and the link is on the path so
dswitch plays no part in running dart.
For this project it occurs every time.
…On Sat, 20 Feb 2021, 3:01 am Alexander Aprelev, ***@***.***> wrote:
DNS resolution change(looking up ipv4 and ipv6 in parallel) targeted osx,
should not have affected other os.
@bsutton <https://github.com/bsutton> how easy is to reproduce the
failure? Are you issuing dart pub upgrade --null-safety from the shell or
it is executed by dswitch? Has it started from a particular revision (of
dart or flutter)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#45047 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG32OGG3KEQUS3PSK6FXYTS72DOJANCNFSM4X3KWNRA>
.
|
This is a dart project not flutter and in using the stand-alone dart sdk
…On Sat, 20 Feb 2021, 3:01 am Alexander Aprelev, ***@***.***> wrote:
DNS resolution change(looking up ipv4 and ipv6 in parallel) targeted osx,
should not have affected other os.
@bsutton <https://github.com/bsutton> how easy is to reproduce the
failure? Are you issuing dart pub upgrade --null-safety from the shell or
it is executed by dswitch? Has it started from a particular revision (of
dart or flutter)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#45047 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG32OGG3KEQUS3PSK6FXYTS72DOJANCNFSM4X3KWNRA>
.
|
We did go from I'd suspect cancellation as the source of this issue due to suspicious non-symmetry in the code: notice how many places where Indeed the following test case seems to reproduce the problem, or at least something that looks like the same exception: $ cat /tmp/repro.dart
import 'dart:io';
void main() async {
try {
final task = await Socket.startConnect('google.com', 80);
task.cancel();
await task.socket;
} catch (e) {}
}
$ dart /tmp/repro.dart
Unhandled exception:
Bad state: Future already completed
#0 _AsyncCompleter.complete (dart:async/future_impl.dart:45:31)
#1 _NativeSocket.tryConnectToResolvedAddresses.connectNext.<anonymous closure> (dart:io-patch/socket_patch.dart:847:16)
#2 _NativeSocket.issueWriteEvent.issue (dart:io-patch/socket_patch.dart:1214:14)
#3 _NativeSocket.issueWriteEvent (dart:io-patch/socket_patch.dart:1221:12)
#4 _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:1242:11)
#5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12) |
Thanks @mraleph . That was a good idea for a test. Have https://dart-review.googlesource.com/c/sdk/+/186641 for that. |
Warning, completely off topic Am I the only one who thinks the title 'Bad state: Future already completed' is funny? 😄 |
@bsutton if you have a chance could you please give a try to dart sdk with the fix from the above to see if it improved things for you? 2.13.0-71.0.dev is the first dev build that has the fix in it. That |
https://dart.dev/tools/sdk/archive has 2.13.0-93.0.dev available that should have anticipated fix. |
I should note that I'm using the project https://pub.dev/packages/dswitch to switch between beta/stable version of dart.
I've seen the below error a couple of times now but haven't been paying much attention ( think it may have happened during unit testing?)
The problem doesn't occur if I just run dart pub upgrade
The text was updated successfully, but these errors were encountered: