Skip to content

[release/7.0] Use CLOCK_BOOTTIME to calculate BootTime on linux (#67589) #83966

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

Conversation

simonrozsival
Copy link
Member

@simonrozsival simonrozsival commented Mar 27, 2023

Backport of #67589 and #75334 to release/7.0

/cc @am11 @adamsitnik

Customer impact

A customer reported that they can't use the Process.StartTime API in their Android app (#83816). The problem is that recent Android versions don't allow reading the /proc/stat file anymore. Instead, we use the clock_gettime libc function.

This bug as already been fixed in .NET 8 but we didn't backport it to .NET 7.0 at that time.

Fixes #83816

Testing

Manual testing and unit tests.

Risk

Low. The fix is well tested.

dotnet-maestro bot and others added 2 commits March 23, 2023 17:34
…23.1 (dotnet#83860)

Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100
 From Version 7.0.4 -> To Version 7.0.5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Co-authored-by: Simon Rozsival <simon@rozsival.com>
@simonrozsival simonrozsival added Servicing-consider Issue for next servicing release review area-System.Diagnostics.Process labels Mar 27, 2023
@simonrozsival simonrozsival added this to the 7.0.x milestone Mar 27, 2023
@ghost ghost assigned simonrozsival Mar 27, 2023
@ghost
Copy link

ghost commented Mar 27, 2023

Tagging subscribers to this area: @dotnet/area-system-diagnostics-process
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #67589 to release/7.0

/cc @am11 @adamsitnik

Customer impact

A customer reported that they can't use the Process.StartTime API in their Android app (#83816). The problem is that recent Android versions don't allow reading the /proc/stat file anymore. Instead, we use the clock_gettime libc function.

This bug as already been fixed in .NET 8 but we didn't backport it to .NET 7.0 at that time.

Fixes #83816

Testing

Manual testing and unit tests.

Risk

Low. The fix is well tested.

Author: simonrozsival
Assignees: -
Labels:

Servicing-consider, area-System.Diagnostics.Process

Milestone: 7.0.x

@adamsitnik
Copy link
Member

The CI failures seem related:

    System.Diagnostics.Tests.ProcessTests.GetProcessesByName_ProcessName_ReturnsExpected [FAIL]
      Assert.All() Failure: 2 out of 3 items in the collection did not pass.
      [2]: Item: System.Diagnostics.Process (dotnet)
           Xunit.Sdk.EqualException: Assert.Equal() Failure
           Expected: 2023-03-27T11:42:32.5574906+00:00
           Actual:   2023-03-27T11:42:49.6041245+00:00
              at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/xunit.assert/Asserts/EqualityAsserts.cs:line 96
              at Xunit.Assert.Equal[T](T expected, T actual) in /_/src/xunit.assert/Asserts/EqualityAsserts.cs:line 63
              at System.Diagnostics.Tests.ProcessTests.<>c__DisplayClass90_0.<GetProcessesByName_ProcessName_ReturnsExpected>b__3(Process process) in /_/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs:line 1250
              at Xunit.Assert.All[T](IEnumerable`1 collection, Action`2 action) in /_/src/xunit.assert/Asserts/CollectionAsserts.cs:line 77
      [1]: Item: System.Diagnostics.Process (dotnet)
           Xunit.Sdk.EqualException: Assert.Equal() Failure
           Expected: 2023-03-27T11:42:32.5574906+00:00
           Actual:   2023-03-27T11:42:49.2332694+00:00
              at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/xunit.assert/Asserts/EqualityAsserts.cs:line 96
              at Xunit.Assert.Equal[T](T expected, T actual) in /_/src/xunit.assert/Asserts/EqualityAsserts.cs:line 63
              at System.Diagnostics.Tests.ProcessTests.<>c__DisplayClass90_0.<GetProcessesByName_ProcessName_ReturnsExpected>b__3(Process process) in /_/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs:line 1250
              at Xunit.Assert.All[T](IEnumerable`1 collection, Action`2 action) in /_/src/xunit.assert/Asserts/CollectionAsserts.cs:line 77
      Stack Trace:
        /_/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs(1250,0): at System.Diagnostics.Tests.ProcessTests.GetProcessesByName_ProcessName_ReturnsExpected()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)

@am11
Copy link
Member

am11 commented Mar 27, 2023

We would need to backport #75334 as well.

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for backporting both PRs @simonrozsival !

@simonrozsival
Copy link
Member Author

@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Mar 28, 2023
@rbhanda rbhanda modified the milestones: 7.0.x, 7.0.6 Mar 28, 2023
@carlossanlop
Copy link
Contributor

I'm retargeting this PR to the new release/7.0-staging branch, which is the one that we will use from now on for servicing fixes.

Repo maintainers will now be allowed to merge their own servicing PR as long as it meets the requirements:

  • It is approved by Tactics (signaled by adding the Servicing-approved label).
  • It's signed-off by an area owner.
  • The CI is green, or the failures are investigated as unrelated.
  • And if the PR touches an OOB package, the necessary OOB authoring changes are added.

The new process is described here: runtime/docs/project/library-servicing.md.

The infra team will be actively monitoring servicing PRs to ensure all requirements are met and to help with any issues.

Let me know if you have any questions.

@carlossanlop carlossanlop changed the base branch from release/7.0 to release/7.0-staging March 28, 2023 21:03
@simonrozsival
Copy link
Member Author

Thanks, @carlossanlop.

@simonrozsival
Copy link
Member Author

@simonrozsival
Copy link
Member Author

@carlossanlop I believe all the requirements for merging the backport PR have been met so I'm merging it now.

@simonrozsival simonrozsival merged commit fa133ae into dotnet:release/7.0-staging Mar 31, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 30, 2023
@rbhanda rbhanda modified the milestones: 7.0.6, 7.0.7 Jun 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants