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 invalid memory access when shutting down #8409

Merged
merged 5 commits into from
Nov 22, 2023

Conversation

JaySon-Huang
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #8408

Problem Summary:

There is an invalid memory access. This is because the logging system is already closed

image
image

What is changed and how it works?

When sub_root_of_query_storage_task_mem_trackers and its children are destructoring, it means the process is shutting down and the logging system is stopped.

Suppress the logging of these memory trackers.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    • Add a line after store_idnet is got to mock an exception thrown and tiflash stopped throw Exception("Mock exception thrown");
      if (store_ident)
      {
      RUNTIME_ASSERT(
      store_id == store_ident->store_id(),
      log,
      "store id mismatch store_id={} store_ident.store_id={}",
      store_id,
      store_ident->store_id());
      }
      if (global_context->getSharedContextDisagg()->isDisaggregatedComputeMode())
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 22, 2023
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 22, 2023
@@ -18,6 +18,7 @@
#include <common/types.h>

#include <atomic>
#include <boost/noncopyable.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

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

This header seems unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is need by struct TemporarilyDisableMemoryTracker : private boost::noncopyable in line 192

dbms/src/Common/MemoryTracker.h Outdated Show resolved Hide resolved
Co-authored-by: jinhelin <linjinhe33@gmail.com>
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 22, 2023
Copy link
Contributor

ti-chi-bot bot commented Nov 22, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-22 09:08:08.620775748 +0000 UTC m=+395317.286001944: ☑️ agreed by Lloyd-Pottiger.
  • 2023-11-22 09:14:11.336662814 +0000 UTC m=+395680.001889009: ☑️ agreed by JinheLin.

@JaySon-Huang
Copy link
Contributor Author

/approve

Copy link
Contributor

ti-chi-bot bot commented Nov 22, 2023

@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

  • Currently the CI jobs are not prow job style, we need it to notify Jenkins server to run them.
  • If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Copy link
Contributor

ti-chi-bot bot commented Nov 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, JinheLin, Lloyd-Pottiger

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [JaySon-Huang,JinheLin,Lloyd-Pottiger]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

ti-chi-bot bot commented Nov 22, 2023

@JaySon-Huang: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

trigger some heavy tests which will not run always when PR updated.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot bot merged commit f246f35 into pingcap:master Nov 22, 2023
6 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #8412.

@JaySon-Huang JaySon-Huang deleted the fix_shutdown_memtracker branch November 23, 2023 02:40
ti-chi-bot bot pushed a commit that referenced this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid memory access when shutting down process
4 participants