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

Fix Merge operation failed for EtwProfiler #1545

Merged
merged 6 commits into from Oct 26, 2020
Merged

Conversation

adamsitnik
Copy link
Member

Fixes #1544

to tell the long story short, if Long Paths support is enabled on Windows, the ETW might still throw errors.

The fix is to always use 260 characters limit

@adamsitnik adamsitnik changed the title Merge operation failed Fix Merge operation failed for EtwProfiler Oct 2, 2020
@adamsitnik
Copy link
Member Author

@AndreyAkinshin PTAL

@adamsitnik adamsitnik added this to the v0.12.2 milestone Oct 2, 2020
Copy link
Contributor

@WojciechNagorski WojciechNagorski left a comment

Choose a reason for hiding this comment

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

@adamsitnik IMO you fixed the problem but I have some minor comments.

// long paths can be enabled on Windows but it does not mean that ETW is going to work fine..
// so we always use 260 as limit on Windows
int limit = RuntimeInformation.IsWindows()
? WindowsOldPathLimit - "userheap.etl".Length // the session files get merged, they need to have same name (without extension)
Copy link
Contributor

Choose a reason for hiding this comment

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

You could reuse HeapSession.FileExtension. I checked it seems to be the longest extension, so it is a good solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

You could reuse HeapSession.FileExtension

I was thinking about it. The problem is that it's an instance property - so I would need to have an HeapSession instance to get it.

Then I was thinking about introducing an internal const string field to the HeapSession but it was far from perfect:

  • I would need two names for the same thing
  • it would be still possible to introduce a new session type with a longer name.

I think that we can keep it as it is until we find a better solution.

{
[GenericTypeArguments(typeof(byte))] // value type
[GenericTypeArguments(typeof(object))] // reference type
public class RentReturnArrayPoolTests<T>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need such a complicated example?

Copy link
Member Author

Choose a reason for hiding this comment

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

@WojciechNagorski to get a benchmark with a very long name. I was lazy and I just copied it 1:1 from the bug report

@adamsitnik adamsitnik merged commit c6d6fb2 into master Oct 26, 2020
@AndreyAkinshin AndreyAkinshin deleted the mergeOperationFailed branch October 26, 2020 16:35
eiriktsarpalis added a commit to eiriktsarpalis/BenchmarkDotNet that referenced this pull request Mar 29, 2022
Update error message to reflect the change introduced by dotnet#1545
adamsitnik pushed a commit that referenced this pull request Mar 29, 2022
Update error message to reflect the change introduced by #1545
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EtwProfiler] Merge operation failed return code 0x3
3 participants