Skip to content

Synchronize concurrent tasks #4898

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

Closed
MarcoRossignoli opened this issue Nov 7, 2019 · 2 comments
Closed

Synchronize concurrent tasks #4898

MarcoRossignoli opened this issue Nov 7, 2019 · 2 comments
Labels
Area: Engine Issues impacting the core execution of targets and tasks. question triaged
Milestone

Comments

@MarcoRossignoli
Copy link
Member

MarcoRossignoli commented Nov 7, 2019

Hi here Marco from coverlet https://github.com/tonerdo/coverlet

One of most requested feature is "Solution wide coverage".

To do that we need to sync/communicate with concurrent running task https://github.com/tonerdo/coverlet/tree/master/src/coverlet.msbuild.tasks

Is there a build-in mechanism?
If I run for instance dotnet test /p:CollectCoverage=true MergeWith.sln (coverlet-coverage/coverlet#598 (comment)) I see overlapping task instances and concurrent tests.
We should sync CoverageResultTask https://github.com/tonerdo/coverlet/blob/master/src/coverlet.msbuild.tasks/CoverageResultTask.cs#L73 and wait all tests and merge results.

Is there a way/pattern to do this?Or we need to implement custom sync/interprocess communication(we need a unique identifier to group task of same sln build)?

cc: @tonerdo

@MarcoRossignoli MarcoRossignoli changed the title Syncronize concurrent tasks Synchronize concurrent tasks Nov 7, 2019
@rainersigwald
Copy link
Member

There is no built-in mechanism for this. In addition, people rolling their own locks have a long, sad history of causing confusing, hard-to-debug build breaks and hangs. So please consider whether there's any way you can redesign to avoid the need for the synchronization.

@rainersigwald rainersigwald added this to the Discussion milestone Nov 7, 2019
@rainersigwald rainersigwald added Area: Engine Issues impacting the core execution of targets and tasks. question labels Nov 7, 2019
@MarcoRossignoli
Copy link
Member Author

There is no built-in mechanism for this. In addition, people rolling their own locks have a long, sad history of causing confusing, hard-to-debug build breaks and hangs. So please consider whether there's any way you can redesign to avoid the need for the synchronization.

Eh...it's also my concern 😞 but users complain about the fact that msbuild works only with "project" and there are some tool/fields that need to be grouped to "solution" to be useful.
Users want only 1 coverage report file but we can run task only "project based" and also runs in parallel

Thank's for quick response @rainersigwald if you've some link on docs or some project that tackled this problem let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Engine Issues impacting the core execution of targets and tasks. question triaged
Projects
None yet
Development

No branches or pull requests

3 participants