-
Notifications
You must be signed in to change notification settings - Fork 434
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
Use unspecified QoS in QueueScheduler when QoS is unspecified #880
Use unspecified QoS in QueueScheduler when QoS is unspecified #880
Conversation
This change looks pretty logical. If I don't specify the QoS then it should be |
@NachoSoto, could you please consider merging and releasing this change? |
thanks @Vyazovoy & @NachoSoto. i see the required statuses haven't completed for some reason – is there anything else i need to do? |
@jamieQ a maintainer has to approve running the checks (to avoid spamming the CI). I have in the past been able to do that, but either I have been removed as a maintainer or something has changed in GitHub about how you approve running the checks. |
expect(initialQoS).toEventuallyNot(beNil()) | ||
expect(endQoS).toEventuallyNot(beNil()) | ||
|
||
expect(initialQoS).to(equal(QOS_CLASS_USER_INITIATED)) |
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.
@jamieQ this is failing the Linux CI job. You probably need to to add this at the top of this file:
#if canImport(Darwin)
import Darwin
#endif
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.
ah, sorry about that (and thank you for trying to progress this). scouring the internet for a bit made me wonder if the same QoS propagation mechanisms even exist on Linux. assuming they don't, perhaps just wrapping the runtime checks here in that conditional compilation directive would be an appropriate resolution. i'll try to do a bit more research in the near term.
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.
@mluisbrown okay i think it should be good to re-run in CI at your convenience
20a9cce
to
46f953c
Compare
Issue
after doing a bit of research on how libdispatch's 'quality of service' (QoS) propagation logic works, i noticed that the default behavior of
QueueScheduler
is slightly different than what one would get if just using aDispatchQueue
. i'm not sure if this was intentional, but in practice the consequence is that if you do something like this:you end up with the inferred QoS of the scheduled block being set to 'default' QoS, whereas it would be 'user initiated' if using a vanilla
DispatchQueue
. this patch changes the defaultqos
parameter from.default
to.unspecified
to matchDispatchQueue
's default behavior. this change might alter behavior of existing code; hopefully not in a detrimental way, but rather will apply the appropriate QoS propagation that one would assume would occur by default. unfortunately, i realize it's probably impossible to determine if this will cause undesirable changes in existing client code, so i'm open to a different approach or not making this change (though IMO it is semantically more appropriate).Description
QueueScheduler
'sqos
parameter from.default
to.unspecified
Checklist