-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Executors] Improved executor precondition errors #64171
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
Conversation
test/Concurrency/Runtime/actor_assume_executor_general_custom.swift
Outdated
Show resolved
Hide resolved
86c8217 to
3d637d1
Compare
|
@swift-ci please smoke test |
|
|
||
| if #available(SwiftStdlib 5.9, *) { | ||
| tests.test("assumeOnMainActorExecutor: wrongly assume the main executor, from DispatchQueue") { | ||
| expectCrashLater(withMessage: "Expected same executor as actor 'Swift.MainActor' ('MainActorExecutor'), but was executing on '<unknown>'.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unknown here is very much on purpose - we're not on a "swift concurrency executor" at this point in time.
|
Need to verify on optimized build, something is slighly off there |
02ac432 to
86a90c8
Compare
86a90c8 to
a804cb5
Compare
|
@swift-ci please smoke test |
|
So... ../build/Ninja-ReleaseAssert does pass locally, and it seems it is only the optimized build on linux that is failing. Need to get a linux build to reproduce this 🤔 |
|
@swift-ci please smoke test mac weird crash: |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test macOS |
a804cb5 to
ee506b3
Compare
|
@swift-ci please smoke test |
document the get active current executor method
…ctors fix missing default initializer for ExecutorActiveAndRef
b3dc571 to
9aab398
Compare
|
@swift-ci please smoke test |
Looking how getting it just right is rather tricky, i.e. the PR over here just now: #64169 I'm in inclined to try to get the same semantics as closely as possible, by reusing precondition most probably
This improves the executor precondition error messages from:
before:
Precondition failed: Incorrect actor executor assumption; Expected 'UnownedSerialExecutor(executor: (Opaque Value))' executor.improved:
Precondition failed: Incorrect actor executor assumption; Expected 'MainActorExecutor' executor, but was executing on 'a.InlineExecutor'.which is also part of the reason to offer
precondition/assert/assumeAPIs that do the crashing for us, instead of giving users a "get executor" and have them writeprecondition()themselfes.resolves / relates to rdar://106188692