-
Notifications
You must be signed in to change notification settings - Fork 137
Send plugin names to Core #1157
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
base: main
Are you sure you want to change the base?
Conversation
…untime client identity requirement
| activity_task_poller_behavior: PollerBehavior | ||
| nexus_task_poller_behavior: PollerBehavior | ||
| plugins: Sequence[Plugin] | ||
| skip_client_worker_set_check: bool |
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.
I don't love the addition of this to the very public worker config. This was due to validation issues in the tests, correct? How much work do we think it would be to actually just fix those issues? Is there any place where it is really meaningful?
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.
we want to set skip_client_worker_set_check to false for tests. I didn't check how python does things, but in Core, since tests run in parallel and use the same namespace, we were hitting errors from that. No reason to have this check for tests, unless we're explicitly trying to test for it, which we already do in Core.
I can try to remove from here
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.
Makes sense in Core, but exposing it in the public API wouldn't be fun. Let's see if we can find another way around it.
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.
Struggling to think of a way around this, our tests pass in WorkerConfig as a typed dict, and Worker::init also uses the WorkerConfig typed dict.
I feel like it should be fine to expose this publically, for users writing their own tests, if they run their tests in parallel on the same namespace/task queue, they would also want to disable this check
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.
Yeah, I think it's reasonable to expose this publicly
| ) | ||
| .nexus_task_poller_behavior(conf.nexus_task_poller_behavior) | ||
| .plugins( | ||
| conf.plugins |
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.
So, something that will need some discussion here. This PR reports worker plugins. We should discuss whether that is really what we intend. Plugins which exist only in the client and not the worker will be completely invisible. That could potentially be changed here at least for plugins in clients used by workers, though not generally for any client. I think that was something we didn't really think through when we decided to go with heartbeat as a carrier for this information, but maybe we conclude that is fine.
Typescript will be a bit more complicated as well with its additional plugin types.
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.
Discussed offline, we will for now have both worker and client plugins and dedup names
temporalio/bridge/runtime.py
Outdated
| """Python representation of the Rust struct for runtime options.""" | ||
|
|
||
| telemetry: TelemetryConfig | ||
| worker_heartbeat_interval_millis: Optional[int] = 30_000 # 30s |
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.
Do we want the defaults defined by each language, or does this make more sense to take optionally into core and default there? Since this is optional but with a default number, does that mean overriding with None disables heartbeating?
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.
Yeah specifying None here disables heartbeating. so I think we need the default to be passed down to lang as well
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 alternative would be a nested optional or some form of enum, but I accept this is the easiest route.
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.
Wait why is this 30? Isn't our default 60?
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.
🤦 it is.. thanks for catching
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.
This is looking good to me, only thing is the default interval
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.
Nice!
What was changed
Send plugin names over to core for worker heartbeating.
Updated Core to latest main, 9e9a461.
Updated test to validate replacing clients with a client from a different runtime is invalid.
Why?
Worker heartbeating
Checklist
Closes
How was this tested:
Added tests for plugin name propogation, and runtime options configuration
Note
Forward worker plugin names to Core and add runtime options (incl. worker heartbeat); upgrade Rust deps; expose client.plugins; enforce client-runtime match; CI lint step tweaks.
pluginsinWorkerConfig(RustPluginInfo), with optionalskip_client_worker_set_check.replace_clientnow reports errors; Python worker enforces new client uses same runtime.init_runtime(telemetry)withinit_runtime(options); addRuntimeOptions(telemetry +worker_heartbeat_interval_millis).Runtimeacceptsworker_heartbeat_interval; validates and forwards millis.Client.pluginsproperty.9e9a461; bump Rust crates (prost 0.14,tonic 0.14,opentelemetry 0.31,prost-wkt 0.7, etc.) and add new deps (tonic-prost,pulldown-cmark*,dyn-clone).TemporalServiceClientand reworked tonic import.poe lintruns (reordered/duplicated) in build and latest-deps jobs.skip_client_worker_set_checkby default for tests; minor assertions updates.Written by Cursor Bugbot for commit c276572. This will update automatically on new commits. Configure here.