Skip to content

Commit

Permalink
bugfix timer queue processor (#480)
Browse files Browse the repository at this point in the history
change history cache size from 1024 to 256
  • Loading branch information
wxing1292 authored Dec 22, 2017
1 parent 8eaced5 commit c3a2b1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions service/history/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ type Config struct {
func NewConfig(numberOfShards int) *Config {
return &Config{
NumberOfShards: numberOfShards,
HistoryCacheInitialSize: 256,
HistoryCacheMaxSize: 1 * 1024,
HistoryCacheInitialSize: 128,
HistoryCacheMaxSize: 256,
HistoryCacheTTL: time.Hour,
RangeSizeBits: 20, // 20 bits for sequencer, 2^20 sequence number for any range
AcquireShardInterval: time.Minute,
Expand Down
7 changes: 4 additions & 3 deletions service/history/transferQueueProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ func (t *transferQueueProcessorImpl) processDecisionTask(task *persistence.Trans
if err != nil {
return err
}

var mb *mutableStateBuilder
mb, err = context.loadWorkflowExecution()
if err != nil {
Expand Down Expand Up @@ -427,10 +428,10 @@ func (t *transferQueueProcessorImpl) processCloseExecution(task *persistence.Tra
RunId: common.StringPtr(task.RunID)}

context, release, err := t.cache.getOrCreateWorkflowExecution(domainID, execution)
defer release()
if err != nil {
return err
}
defer release()

var mb *mutableStateBuilder
mb, err = context.loadWorkflowExecution()
Expand Down Expand Up @@ -509,10 +510,10 @@ func (t *transferQueueProcessorImpl) processCancelExecution(task *persistence.Tr
var context *workflowExecutionContext
var release releaseWorkflowExecutionFunc
context, release, err = t.cache.getOrCreateWorkflowExecution(domainID, execution)
defer release()
if err != nil {
return err
}
defer release()

// First load the execution to validate if there is pending request cancellation for this transfer task
var msBuilder *mutableStateBuilder
Expand Down Expand Up @@ -598,10 +599,10 @@ func (t *transferQueueProcessorImpl) processStartChildExecution(task *persistenc
var context *workflowExecutionContext
var release releaseWorkflowExecutionFunc
context, release, err = t.cache.getOrCreateWorkflowExecution(domainID, execution)
defer release()
if err != nil {
return err
}
defer release()

// First step is to load workflow execution so we can retrieve the initiated event
var msBuilder *mutableStateBuilder
Expand Down

0 comments on commit c3a2b1e

Please sign in to comment.