Comments (3)
Mentioned in https://pkg.go.dev/go.temporal.io/[email protected]/activity,
Currently cancellation is delivered only to Activities that call RecordHeartbeat.
Is this the cause?
from samples-go.
The sample code is calling RecordHeartbeat
, though, so that's not quite the problem. What appears to be happening is that cancellation is only delivered when a heartbeat is actually sent, and the sdk does batching of heartbeats internally, so that a call to activity.RecordHeartbeat
doesn't necessarily send a heartbeat. The batching is based on the value of HeartbeatTimeout
.
You can see this by changing the duration of f1
to 60 seconds instead of 5 seconds: the activity will be cancelled after around 8 seconds (with HeartbeatTimeout
set to 10 seconds). If you increase HeartbeatTimeout
it'll take longer, and if you decrease it, the cancellation will be delivered sooner. You can see the logic here: https://github.com/temporalio/sdk-go/blob/1ec44328977e7bb896d2d405a8f1334120df282a/internal/internal_task_handlers.go#L1628
So this doesn't seem like a bug, though there's probably room to improve the documentation.
from samples-go.
Thanks @dnr for your clarification! However, these internals seem a bit obscure to new comers. I submitted a PR (#111) in hopes that it could help others better understand the sample. If it doesn't fit the purpose of the sample, please let me know.
from samples-go.
Related Issues (20)
- [Feature Request] search demo using golang zinc HOT 1
- [Doc] Explain why goroutine sample is threadsafe HOT 4
- go.temporal.io/server-v1.15.2: 1 vulnerabilities (highest severity is: 7.5) - autoclosed HOT 3
- [Feature Request] Add schedules example
- Reporting a vulnerability HOT 1
- [Bug] Samples-go do not build on server 1.20.1 HOT 1
- go.temporal.io/sdk/contrib/tools/workflowcheck-v0.0.0-20230413153418-eaa3802876de: 3 vulnerabilities (highest severity is: 6.1) - autoclosed HOT 1
- Update sample should early exit if update is not enabled and provide instruction to enable. HOT 1
- [Feature Request] Add a sample with opentelemetry tracing HOT 9
- [Bug] DevContainer doesn't start the temporal server image HOT 2
- Go Worker versioning samples
- go.temporal.io/sdk/contrib/tools/workflowcheck-v0.0.0-20230612164027-11c2cb9e7d2d: 3 vulnerabilities (highest severity is: 6.1) - autoclosed HOT 1
- [Bug] serverjwtauth sample doesn't work with newer servers
- CreateSession doesn't work. HOT 2
- [Bug] devcontainer usage HOT 2
- [Bug] reqrespactivity/reqrespquery samples have wrong assumpion about Selector.HasPending
- Add Sample for Typed equivalents for workflow.* functions/interfaces using generics HOT 1
- Sample request: Rate limiting or semaphore implemented as a workflow
- [Feature Request] Temporal server release with otel upgrade HOT 1
- [Feature Request] Sentry sample
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samples-go.