-
Notifications
You must be signed in to change notification settings - Fork 49
Macro defaults: enter_on_poll & scope #133
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
I appreciate you bringing these up. I haven't been able to come up with an overwheelming better design. But I could exhibit some ideas behind the current design for later evolution/refactoring. Before v0.4, minitrace has two separate macros, respectively Thus, If |
cc @zhongzc |
Not sure I understand:
To clarify: You'd like there to be consistency, by default, in the number of spans generated by one call of a sync function and and one call of an async function. Related: Am I correct in understanding that |
Correct
Correct |
Ok, I see the symmetry in having that as default behavior. However, the point of using async is to have your code run concurrently, or in parallel, with other functions. From the perspective of a user that has just changed: #[trace]
fn io_bound(){ ... } into #[trace]
async fn io_bound(){ ... } I believe they would expect to see, say in Jaeger, multiple spans for What is the use case/scenario where having async functions appear once adds value? |
The first request that I know so far is #64 (comment) |
Thanks. That was informative. I understood those comments as requesting the option to make async function appear to be sync. However, I did not understand them to be making the case the option should be the default. In fact they are use-case/context specific. Further, in the 6-months that issue was open only two (2) users showed up with a need for that option. I'd tend to agree with @zhongzc comment in that issue, and take this to be the use of tracing in 80% of cases:
However, I am trying to convince you to go back to the default behavior. for the reasons @zhongzc outlined, and the one I set out earlier. |
ping @zhongzc |
Voided by PR #127 rejection. |
I've reached the Model stage of the pipeline is #113. This involves setting up defaults....
Current macro implementation has some confusing, to my mind, defaults. Described here.
Proposal is for these defaults (macro impl details follow, but you get the idea):
None
(sync)Some(true)
(async)Local
(sync, is current default),Local
(async) & this follows from enter-on-poll default (above) beingtrue
(correct?)If
enter_on_poll=false
then convention is for default span-scope to beThreads
.My expectation is that if you just want to add
#[trace]
, it is likely you're new or (more likely) an occasional user needing to debug something now - you're already having a lousy day, and we shouldn't force you to dive into docs to find out what you need to do to get the help you need... in these cases enter-on-poll is likely to be what you want when debugging? Also if you're new to async we don't hide the effect of polling.Regular users will already know what they want.
I believe these defaults are consistent with the rust-lang goal of 'empowering everyone' here it is new/occasional users. Also for these users their productivity is enhanced - at a cost to regular users who want a different default. However thos regular/power users are still empowered to do what they want, just with some additional cost of having to enter their desired parameters.
Thoughts?
The text was updated successfully, but these errors were encountered: