Skip to content

Support platforms back to macOS 10.15, iOS 13, tvOS 13, and watchOS 6 #7

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

Merged
merged 8 commits into from
Jun 13, 2023

Conversation

denil-ct
Copy link
Contributor

@denil-ct denil-ct commented Jun 12, 2023

Motivation

Reduce deployment target by 3 versions to gain more adoption.

Modifications

  • Added new deployment targets
  • Refactor invokeSession method to support iOS 13+
  • TODO: Update swift-openapi-runtime version once changes are done there.

Result

Deployment target will be reduced by 3 versions.

@denil-ct denil-ct requested a review from czechboy0 June 12, 2023 20:18
@czechboy0 czechboy0 requested a review from simonjbeaumont June 12, 2023 20:36
@simonjbeaumont
Copy link
Collaborator

@swift-server-bot add to allowlist

@apple apple deleted a comment from czechboy0 Jun 12, 2023
@apple apple deleted a comment from czechboy0 Jun 12, 2023
Copy link
Collaborator

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @denil-ct for diving in on this one. I left a comment to explore whether this method selection is necessary.

If you're wondering about the "soundness" CI failure, it's failing on swift-format. You should be able to run that locally, from the scripts/ directory.

@denil-ct
Copy link
Contributor Author

@czechboy0 could you create a new release for the runtime, since the PR has been merged there?

@simonjbeaumont
Copy link
Collaborator

@czechboy0 could you create a new release for the runtime, since the PR has been merged there?

@denil-ct https://github.com/apple/swift-openapi-runtime/releases/tag/0.1.3

@denil-ct
Copy link
Contributor Author

@simonjbeaumont @czechboy0 please review and merge

@simonjbeaumont simonjbeaumont changed the title Reduce deployment target by 3 versions Support platforms back to macOS 10.15, iOS 13, tvOS 13, and watchOS 6 Jun 13, 2023
Copy link
Collaborator

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @denil-ct!

@simonjbeaumont simonjbeaumont merged commit 0ce8765 into apple:main Jun 13, 2023
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Jun 13, 2023
simonjbeaumont added a commit that referenced this pull request Jan 16, 2024
…#46)

### Motivation

When running the cancellation tests in a loop, very occasionally there
would be a crash with the following backtrace:

```
#0	0x000000018aa008d4 in objc_opt_respondsToSelector ()
#1	0x000000018aea3410 in _outputStreamCallbackFunc ()
#2	0x000000018aea3310 in _signalEventSync ()
#3	0x000000018aeecdb0 in ___signalEventQueue_block_invoke ()
#4	0x000000018abe6cb8 in _dispatch_call_block_and_release ()
#5	0x000000018abe8910 in _dispatch_client_callout ()
#6	0x000000018abefea4 in _dispatch_lane_serial_drain ()
#7	0x000000018abf0a08 in _dispatch_lane_invoke ()
#8	0x000000018abfb61c in _dispatch_root_queue_drain_deferred_wlh ()
#9	0x000000018abfae90 in _dispatch_workloop_worker_thread ()
#10	0x000000018ad96114 in _pthread_wqthread ()
```

This seems to indicate that the output stream is trying to access its
delegate. However, when running with debug logging enabled I can see
that the delegate has already been deinitialized.

This is likely a result of the delegate itself owning the stream and
setting the stream delegate to `self`, which IIUC is an established
pattern. This presents a race in teardown.

### Modifications

This patch sets the output stream delegate to `nil` in the delegate
`deinit`.

### Result

No attempts to call the delegate will happen after it is has been
deinitailzed.

### Test Plan

With this patch, the failing test passes when run an order of magnitude
more times than were required to reliably reproduce the crash without
the patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants