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

Hotfix/unarchiving timeout #4544

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "8.7.3",
"version": "8.7.4",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
Expand Down
4 changes: 2 additions & 2 deletions common/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "common",
"version": "8.7.3",
"version": "8.7.4",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions config/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "common",
"version": "8.7.3",
"version": "8.7.4",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "8.7.3",
"version": "8.7.4",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
Expand Down
1 change: 1 addition & 0 deletions server/src/core/server/models/story/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ export async function retrieveStoryToBeUnarchived(
},
{
returnOriginal: false,
maxTimeMS: 30 * 60 * 1000,
}
);

Expand Down
3 changes: 2 additions & 1 deletion server/src/core/server/queue/tasks/unarchiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const createJobProcessor = ({
throw new Error("unable to unarchive story");
}

log.debug({ took: timer() }, "attempted unarchive operation ended");
log.info({ storyID, took: timer() }, "attempted unarchive operation ended");
};
};

Expand All @@ -101,5 +101,6 @@ export function createUnarchiverTask(
jobIdGenerator: ({ tenantID, storyID }) =>
`${tenantID}:${storyID}:unarchive`,
attempts: 1,
timeout: 1 * 60 * 60 * 1000,
});
}
6 changes: 4 additions & 2 deletions server/src/core/server/services/archive/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export async function unarchiveStory(
const logger = log.child({ storyID: id });
logger.info("starting to unarchive story");

const targetStory = await mongo.stories().findOne({ id, tenantID });
const targetStory = await mongo
.stories()
.findOne({ id, tenantID }, { maxTimeMs: 30 * 60 * 1000 });
if (!targetStory) {
throw new StoryNotFoundError(id);
}
Expand Down Expand Up @@ -203,7 +205,7 @@ async function moveDocuments<T extends { id: string }>({
let deleteIDs: string[] = [];
const allIDs: string[] = [];

const selectionCursor = source.find(filter);
const selectionCursor = source.find(filter, { maxTimeMs: 30 * 60 * 1000 });

while (await selectionCursor.hasNext()) {
const document = await selectionCursor.next();
Expand Down
Loading