Skip to content
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

Remove BacklogManager from AckManager #7067

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

stephanos
Copy link
Contributor

@stephanos stephanos commented Jan 10, 2025

What changed?

Removes the reference to BacklogManager from AckManager.

Why?

Removes circular dependency.

How did you test it?

Existing tests. No behavior change is expected.

Potential risks

Documentation

Is hotfix candidate?

@stephanos stephanos marked this pull request as ready for review January 10, 2025 18:03
@stephanos stephanos requested a review from a team as a code owner January 10, 2025 18:03
Copy link
Contributor

@ychebotarev ychebotarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a part of this PR.
I see logger is only used in func (m *ackManager) addTask.
logger is used as logger.Fatal, but execution continues without returning any error.
it is used in only in func (tr *taskReader) addSingleTaskToBuffer(:
tr.backlogMgr.taskAckManager.addTask(task.GetTaskId())

which does return error. Is that intended?
should addTask continue in those logger.Fatal cases like "Already present in outstanding tasks"?

@stephanos
Copy link
Contributor Author

Good question, Yuri; cc @ShahabT ?

@stephanos stephanos requested review from dnr and ShahabT January 13, 2025 18:36
@ShahabT
Copy link
Collaborator

ShahabT commented Jan 13, 2025

cc @dnr to answer the question about addTask fatal log.

@stephanos stephanos merged commit 2a77eca into temporalio:main Jan 13, 2025
49 checks passed
@stephanos stephanos deleted the matching-remove-bmg-ref branch January 13, 2025 22:38
@dnr
Copy link
Member

dnr commented Jan 14, 2025

I'm not sure I understand the question, but:

Those Fatal logs are invariants that indicate a bug in code using ackManager. Possibly there is some way to recover if the invariant is violated but given that there is currently no bug in the usage of ackManager (that I know of), I don't think we should relax the checks to recover better from a future hypothetical bug.

Also note that addSingleTaskToBuffer and addTasksToBuffer technically return an error, but getTasksPump doesn't actually handle an error return in any reasonable way (it just ignores it, with a comment saying only context errors are possible, which is true now), so it's not really true that we could recover some correct behavior by returning an error there instead of log.Fatal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants