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

S192 : seq num fix #35

Merged
merged 3 commits into from
Feb 1, 2025
Merged

S192 : seq num fix #35

merged 3 commits into from
Feb 1, 2025

Conversation

eschultink
Copy link
Member

Fixes

  • add delay to task eta, in hope that it datastore txn commits before task executes
  • clean-up exceptions

Change implications

  • breaking change to API? no
  • changes dependencies? no

@eschultink eschultink self-assigned this Feb 1, 2025
@@ -85,7 +89,7 @@ private static RetryerBuilder baseRetryerBuilder() {
.retryIfExceptionOfType(ApiProxyException.class)
// don't think this is thrown by new datastore lib
// thrown by us if the task state is from the past
.retryIfExceptionOfType(ConcurrentModificationException.class)
.retryIfExceptionOfType(IllegalStateException.class)
Copy link
Member Author

Choose a reason for hiding this comment

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

changed this, bc I think it more accurate reflects what the situation is.

I don't think it's getting concurrently modified; I think the task is executing before txn is committed OR before txn outcome can be seen

tx.commit();
scheduleWorkerTask(settings, taskState, null);
Copy link
Member Author

Choose a reason for hiding this comment

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

this should help too; don't enqueue task until AFTER we've successfully committed.

We do have a risk that if enqueuing task fails, shard will just stall out, right? Nothing to recover it and ensure it eventually gets executed.

@@ -183,21 +187,23 @@ private void scheduleControllerTask(ShardedJobRunId jobId, IncrementalTaskId tas
.param(TASK_ID_PARAM, taskId.toString());
taskOptions.header("Host", settings.getTaskQueueTarget());

taskOptions.etaMillis(System.currentTimeMillis() + CONTROLLER_TASK_DELAY);
Copy link
Member Author

Choose a reason for hiding this comment

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

added some delay here, bc again we're inside a txn, but enqueuing in the middle of it rather than at the end.

@eschultink eschultink merged commit 14bf789 into main Feb 1, 2025
5 checks passed
@eschultink eschultink deleted the s192-seq-num-fix branch February 1, 2025 18:14
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.

2 participants