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

Pivotal ID # 185352396: Fixed Concurrency File Operations #744

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

jhoanmanuelms
Copy link
Contributor

https://www.pivotaltracker.com/story/show/185352396

  • Make submit operations fully suspended
  • Improve some tests structure

- Make submit operations fully suspended
- Improve some tests structure
@jhoanmanuelms jhoanmanuelms self-assigned this Sep 1, 2023
Copy link
Contributor

@Juan-EBI Juan-EBI left a comment

Choose a reason for hiding this comment

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

Fantastic changes please consider questions before merge.

private fun processSafely(request: RequestMessage, process: RequestMessage.() -> Unit) {
runCatching { process(request) }.onFailure { onError(it, request) }
private fun processSafely(request: RequestMessage, process: suspend RequestMessage.() -> Unit) {
runCatching { runBlocking { process(request) } }.onFailure { onError(it, request) }
Copy link
Contributor

Choose a reason for hiding this comment

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

I wondering if this is working correctly I mean if in error we get the exception of real problem of the issue or if it get wrapper in a CorotuineException or something like that that and we need to use the cause of the exception and no the exception itself. Did you check this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, it should be the other way around: runCatching inside runBlocking. Nice catch 😁👍

every { extSerializationService.deserialize(submissionJson) } returns extSubmission

mvc.multipart("/submissions/extended") {
content = submissionJson
param(SUBMISSION, submissionJson)
}.andExpect {
}.asyncDispatch().andExpect {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed? what does it do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since now the endpoint is async, we need this to properly call the mock mvc object

- Fully suspended endpoints
- Use supervisor scope instead of default dispatchers
- Remove spring async timeout
@jhoanmanuelms jhoanmanuelms merged commit eba6b58 into master Sep 11, 2023
@jhoanmanuelms jhoanmanuelms deleted the feature/pivotal-#185352396-fully-suspend branch September 11, 2023 13:11
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