Skip to content

Commit b908498

Browse files
authored
Merge branch 'uber-go:master' into expose-history
2 parents 04e9d27 + bdc3c39 commit b908498

File tree

4 files changed

+136
-4
lines changed

4 files changed

+136
-4
lines changed

CHANGELOG.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,85 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [v1.0.2] - 2023-09-25
10+
### Added
11+
- Add a structured error for non-determinism failures
12+
13+
### Changed
14+
- Do not log when automatic heart beating fails due to cancellations
15+
16+
## [v1.0.1] - 2023-08-14
17+
### Added
18+
- Emit cadence worker's hardware utilization inside worker once per host by @timl3136 in #1260
19+
### Changed
20+
- Updated supported Go version to 1.19
21+
- Log when the automatic heartbeating fails
22+
- Updated golang.org/x/net and github.com/prometheus/client_golang
23+
24+
## [v1.0.0] - 2023-07-12
25+
- add refresh tasks API to client by @mkolodezny in #1162
26+
- Exclude idls subfolder from licencegen tool by @vytautas-karpavicius in #1163
27+
- Upgrade x/sys and quantile to work with Go 1.18 by @Groxx in #1164
28+
- Stop retrying get-workflow-history with an impossibly-short timeout by @Groxx in #1171
29+
- Rewrite an irrational test which changes behavior based on compiler inlining by @Groxx in #1172
30+
- Deduplicate retry tests a bit by @Groxx in #1173
31+
- Prevent local-activity panics from taking down the worker process by @Groxx in #1169
32+
- Moving retryable-err checks to errors.As, moving some to not-retryable by @Groxx in #1167
33+
- Apparently copyright isn't checked by CI by @Groxx in #1175
34+
- Another missed license header by @Groxx in #1176
35+
- Add JitterStart support to client by @ZackLK in #1178
36+
- Simplify worker options configuration value propagation by @shijiesheng in #1179
37+
- Sharing one of my favorite "scopes" in intellij, and making it easier to add more by @Groxx in #1182
38+
- Add poller autoscaler by @shijiesheng in #1184
39+
- add poller autoscaling in activity and decision workers by @shijiesheng in #1186
40+
- Fix bug with workflow shadower: ALL is documented as an allowed Status; test and fix. by @ZackLK in #1187
41+
- upgrade thrift to v0.16.0 and tchannel-go to v1.32.1 by @shijiesheng in #1189
42+
- [poller autoscaler] fix logic to identify empty tasks by @shijiesheng in #1192
43+
- Maintain a stable order of children context, resolves a non-determinism around cancels by @Groxx in #1183
44+
- upgrade fossa cli to latest and remove unused fossa.yml by @shijiesheng in #1196
45+
- Retry service-busy errors after a delay by @Groxx in #1174
46+
- changing dynamic poller scaling strategy. by @mindaugasbarcauskas in #1197
47+
- Fix flaky test by @mindaugasbarcauskas in #1201
48+
- updating go client dependencies. by @mindaugasbarcauskas in #1200
49+
- version metrics by @allenchen2244 in #1199
50+
- Export GetRegisteredWorkflowTypes so I can use in shadowtest. by @ZackLK in #1202
51+
- Add GetUnhandledSignalNames by @longquanzheng in #1203
52+
- Adding go version check when building locally. by @mindaugasbarcauskas in #1209
53+
- update CI go version. by @mindaugasbarcauskas in #1210
54+
- ran "make fmt" by @mindaugasbarcauskas in #1206
55+
- Updating IDL version for go client. by @mindaugasbarcauskas in #1211
56+
- Adding ability to provide cancellation reason to cancelWorkflow API by @mindaugasbarcauskas in #1213
57+
- Expose WithCancelReason and related types publicly, as originally intended by @Groxx in #1214
58+
- Add missing activity logger fields for local activities by @Groxx in #1216
59+
- Modernize makefile like server, split tools into their own module by @Groxx in #1215
60+
- adding serviceBusy tag for transient-poller-failure counter metric. by @mindaugasbarcauskas in #1212
61+
- surface more information in ContinueAsNewError by @shijiesheng in #1218
62+
- Corrected error messages in getValidatedActivityOptions by @jakobht in #1224
63+
- Fix TestActivityWorkerStop: it times out with go 1.20 by @dkrotx in #1223
64+
- Fixed the spelling of replay_test file. by @agautam478 in #1226
65+
- Add more detail to how workflow.Now behaves by @Groxx in #1228
66+
- Part1: Record the data type change scenario for shadower/replayer test suite by @agautam478 in #1227
67+
- Document ErrResultPending's behavioral gap explicitly by @Groxx in #1229
68+
- Added the Activity Registration required failure scenario to replayer test suite by @agautam478 in #1231
69+
- Shift replayer to prefer io.Reader rather than filenames by @Groxx in #1234
70+
- Expose activity registry on workflow replayer by @Groxx in #1232
71+
- Merged the timeout logic for the tests in internal_workers_test.go by @jakobht in #1225
72+
- [error] surface more fields in ContinueAsNew error by @shijiesheng in #1235
73+
- Add and emulate the issues found in the workflows involving coroutines into the replayersuite. by @agautam478 in #1237
74+
- Add the change in branch number case(test) to replayersuite by @agautam478 in #1236
75+
- Locally-dispatched activity test flakiness hopefully resolved by @Groxx in #1240
76+
- Switched to revive, goimports, re-formatted everything by @Groxx in #1233
77+
- Add the case where changing the activities (addition/subtraction/modification in current behavior) in the switch case has no effect on replayer. by @agautam478 in #1238
78+
- Replaced Activity.RegisterWithOptions with replayers own acitivty register by @agautam478 in #1242
79+
- [activity/logging] produce a log when activities time out by @sankari165 in #1243
80+
- Better logging when getting some nondeterministic behaviours by @jakobht in #1245
81+
- make fmt fix by @Groxx in #1246
82+
- Test-suite bugfix: local activity errors were not encoded correctly by @Groxx in #1247
83+
- Extracting the replayer specific utilities into a separate file for readability. by @agautam478 in #1244
84+
- Adding WorkflowType to "Workflow panic" log-message by @dkrotx in #1259
85+
- Adding in additional header to determine a more stable isolation-group by @davidporter-id-au in #1252
86+
- Bump version strings for 1.0 release by @Groxx in #1261
87+
988
## [v0.19.0] - 2022-01-05
1089
### Added
1190
- Added JWT Authorization Provider. This change includes a dependency that uses v2+ go modules. They no longer match import paths, meaning that we have to **drop support for dep & glide** in order to use this. [#1116](https://github.com/uber-go/cadence-client/pull/1116)

internal/internal_task_handlers.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,15 +1498,23 @@ func (i *cadenceInvoker) heartbeatAndScheduleNextRun(details []byte) error {
14981498
i.Unlock()
14991499

15001500
// Log the error outside the lock.
1501-
if err != nil {
1502-
i.logger.Error("Failed to send heartbeat", zap.Error(err), zap.String(tagWorkflowType, i.workflowType), zap.String(tagActivityType, i.activityType))
1503-
}
1501+
i.logFailedHeartBeat(err)
15041502
}()
15051503
}
15061504

15071505
return err
15081506
}
15091507

1508+
func (i *cadenceInvoker) logFailedHeartBeat(err error) {
1509+
// If the error is a canceled error do not log, as this is expected.
1510+
var canceledErr *CanceledError
1511+
1512+
// We need to check for nil as errors.As returns false for nil. Which would cause us to log on nil.
1513+
if err != nil && !errors.As(err, &canceledErr) {
1514+
i.logger.Error("Failed to send heartbeat", zap.Error(err), zap.String(tagWorkflowType, i.workflowType), zap.String(tagActivityType, i.activityType))
1515+
}
1516+
}
1517+
15101518
func (i *cadenceInvoker) internalHeartBeat(details []byte) (bool, error) {
15111519
isActivityCancelled := false
15121520
timeout := time.Duration(i.heartBeatTimeoutInSec) * time.Second

internal/internal_task_handlers_test.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,51 @@ func (t *TaskHandlersTestSuite) TestHeartBeat_Interleaved() {
13811381
time.Sleep(1 * time.Second)
13821382
}
13831383

1384+
func (t *TaskHandlersTestSuite) TestHeartBeatLogNil() {
1385+
core, obs := observer.New(zap.ErrorLevel)
1386+
logger := zap.New(core)
1387+
1388+
cadenceInv := &cadenceInvoker{
1389+
identity: "Test_Cadence_Invoker",
1390+
logger: logger,
1391+
}
1392+
1393+
cadenceInv.logFailedHeartBeat(nil)
1394+
1395+
t.Empty(obs.All())
1396+
}
1397+
1398+
func (t *TaskHandlersTestSuite) TestHeartBeatLogCanceledError() {
1399+
core, obs := observer.New(zap.ErrorLevel)
1400+
logger := zap.New(core)
1401+
1402+
cadenceInv := &cadenceInvoker{
1403+
identity: "Test_Cadence_Invoker",
1404+
logger: logger,
1405+
}
1406+
1407+
var workflowCompleatedErr CanceledError
1408+
cadenceInv.logFailedHeartBeat(&workflowCompleatedErr)
1409+
1410+
t.Empty(obs.All())
1411+
}
1412+
1413+
func (t *TaskHandlersTestSuite) TestHeartBeatLogNotCanceled() {
1414+
core, obs := observer.New(zap.ErrorLevel)
1415+
logger := zap.New(core)
1416+
1417+
cadenceInv := &cadenceInvoker{
1418+
identity: "Test_Cadence_Invoker",
1419+
logger: logger,
1420+
}
1421+
1422+
var workflowCompleatedErr s.WorkflowExecutionAlreadyCompletedError
1423+
cadenceInv.logFailedHeartBeat(&workflowCompleatedErr)
1424+
1425+
t.Len(obs.All(), 1)
1426+
t.Equal("Failed to send heartbeat", obs.All()[0].Message)
1427+
}
1428+
13841429
func (t *TaskHandlersTestSuite) TestHeartBeat_NilResponseWithError() {
13851430
mockCtrl := gomock.NewController(t.T())
13861431
mockService := workflowservicetest.NewMockClient(mockCtrl)

internal/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ package internal
4343
// Due to all of this unreliability, this should be used as strictly informational
4444
// metadata, e.g. for caller version monitoring, never behavioral (use
4545
// FeatureVersion or feature flags instead).
46-
const LibraryVersion = "1.0.1"
46+
const LibraryVersion = "1.0.2"
4747

4848
// FeatureVersion is a semver that informs the server of what high-level behaviors
4949
// this client supports.

0 commit comments

Comments
 (0)