-
Notifications
You must be signed in to change notification settings - Fork 8
Fixed new survey import concurrency issue #4347
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
7dcc03c
run survey creation in job
SteRiccio b0c3375
fix import survey db lock
SteRiccio 92378ce
survey create: close job dialog on complete
SteRiccio 5678c55
Potential fix for pull request finding
SteRiccio 2b35dd5
fixed survey creation starvation lock in user access request
SteRiccio 8c0ae32
Merge branch 'fix/survey-import-concurrency' of github.com:openforis/…
SteRiccio 43bcb3b
use latest arena-server
SteRiccio 0da1bde
fix: restore arena-server 1.3.27 to recover failing build
Copilot 356a38c
Revert "fix: restore arena-server 1.3.27 to recover failing build"
SteRiccio ac3f23b
fixed tests
SteRiccio 1f74dee
docs: add design spec for survey import concurrency stress test
SteRiccio a78c234
test(load): add latency stats helper for survey import stress test
SteRiccio 6caf663
test(load): add CLI config parsing for survey import stress test
SteRiccio c83f1b3
test(load): add summary report formatting for survey import stress test
SteRiccio 131ae72
fix(load): restructure latency stats lines to fit 120-char print width
SteRiccio ac19e3e
test(load): add HTTP client for survey import stress test
SteRiccio b9a631d
feat(load): add survey import concurrency stress test CLI
SteRiccio e6683e6
fix(load): use glob for node --test since directory args don't auto-d…
SteRiccio 910a1a3
fix(load): don't let a polling error abort the whole concurrent batch
SteRiccio d87f62d
docs: document JobQueue serialization discovery and rescoped design
SteRiccio 5dbe61c
docs: add addendum tasks 6-8 to fix job-result bug and rescope to N u…
SteRiccio b56ab10
fix(load): read error response bodies safely, add createUser
SteRiccio a2fa6a5
fix(load): make job polling total and thread fetchImpl through the or…
SteRiccio 0250065
fix(load): align userProvisioning placeholder with Task 8's planned c…
SteRiccio c1dda7b
feat(load): provision N throwaway users instead of one shared login
SteRiccio a7b146f
test(load): assert the import call uses the new user's token, not the…
SteRiccio 3505e1b
fix(load): make survey cleanup authoritative, validate createUser res…
SteRiccio c54b52a
fix(load): randomize throwaway user password, warn on non-localhost t…
SteRiccio 6cd6919
fix(test): return a proper numeric comparator when sorting unit test …
SteRiccio d563cc1
fix(load): resolve SonarCloud findings on PR #4347
SteRiccio 4bb6f13
refactor(load): convert test/load to TypeScript
SteRiccio 9614706
chore(tsconfig): replace deprecated moduleResolution "node" with "bun…
SteRiccio 620f611
chore(tsconfig): drop deprecated baseUrl, paths now resolve relative …
SteRiccio 4857739
Potential fix for pull request finding
SteRiccio 7267be7
fix(load): retry login on 429 instead of reporting a spurious failure
SteRiccio 5a705a6
Merge branch 'fix/survey-import-concurrency' of github.com:openforis/…
SteRiccio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import Job from '@server/job/job' | ||
|
|
||
| import * as Survey from '@core/survey/survey' | ||
|
|
||
| import * as SurveyManager from '../manager/surveyManager' | ||
|
|
||
| export default class SurveyCreateJob extends Job { | ||
| constructor(params) { | ||
| super(SurveyCreateJob.type, params) | ||
| } | ||
|
|
||
| async execute() { | ||
| const { user, surveyInfo, createRootEntityDef, updateUserPrefs, temporary } = this.context | ||
|
|
||
| // Insert survey out of this job's own transaction (this.tx): SurveyManager.insertSurvey creates the | ||
| // survey data schema, which uses its own separate db connections and must not run inside an open one. | ||
| const survey = await SurveyManager.insertSurvey({ | ||
|
SteRiccio marked this conversation as resolved.
|
||
| user, | ||
| surveyInfo, | ||
| createRootEntityDef, | ||
| updateUserPrefs, | ||
| temporary, | ||
| }) | ||
|
|
||
| const surveyId = Survey.getId(survey) | ||
|
|
||
| this.setContext({ survey, surveyId }) | ||
| } | ||
|
|
||
| async beforeSuccess() { | ||
| const { surveyId } = this.context | ||
| this.setResult({ surveyId }) | ||
| } | ||
| } | ||
|
|
||
| SurveyCreateJob.type = 'SurveyCreateJob' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.