Skip to content

Add Chinese README file (README_zh.md) #64

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ServerlessApplicationRun

This commit introduces a Chinese version of the README file (README_zh.md). The content is based on the original English README and information gleaned from the project's wiki, which already contains extensive Chinese documentation.

The new README_zh.md provides:

  • A brief introduction to TProfiler.
  • A note about the Java 6 requirement.
  • A link to the project wiki for more detailed information and documentation.
  • Information on how to contribute to the project.

This commit introduces a Chinese version of the README file (README_zh.md).
The content is based on the original English README and information gleaned
from the project's wiki, which already contains extensive Chinese documentation.

The new README_zh.md provides:
- A brief introduction to TProfiler.
- A note about the Java 6 requirement.
- A link to the project wiki for more detailed information and documentation.
- Information on how to contribute to the project.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This commit introduces changes to improve null-safety in the TProfiler core library.

Key changes:

- In `Profiler.java`:
  - `start4Mysql()`: Input parameters `host`, `db`, and `sql` are now defaulted to an empty string if null, preventing nulls from being stored in the profiling stack for these fields.
  - `end4Mysql()`: Uses `String.valueOf()` when retrieving these parameters from the stack for logging, providing an additional layer of safety.

- In `ProfConfig.java`:
  - All String getter methods (e.g., `getStartProfTime()`, `getExcludeClassLoader()`, `getLogFilePath()`) have been modified. They now return an empty string (`""`) if the underlying configuration property was not set (i.e., the field was null). This makes the configuration class more robust and safer for consumers.

Other classes like `Manager.java`, `ThreadData.java`, `SlowQueryData.java`, and `ProfStack.java` were reviewed, and their existing null-handling or initialization patterns were deemed sufficient for NPE prevention in their current context.
This commit introduces several security hardening measures and corrects resource management issues:

Network Security (InnerSocketThread & related):
- ServerSocket now binds to 127.0.0.1 by default.
- Added `profiler.socket.bindaddress` property to configure the bind address.
- Implemented optional token-based authentication via `profiler.socket.authtoken` property.
  Commands must be prefixed with "token@" if auth token is set.
- TProfilerClient updated to send token from CLI.
- Enforced a maximum command length in InnerSocketThread to prevent DoS.
- Added `getProfConfig()` to Manager.java.

Resource Management:
- ProfConfig: Added null checks before closing streams in `extractDefaultProfile`.
- DataDumpThread:
  - Ensured `mysqlFileWriter` is closed in the finally block.
  - Improved path handling for `mysqlProfiler.log`, defaulting to current dir if main log path has no parent.
  - Added null checks for file writers before use in dump methods and robust initialization.
- DailyRollingFileWriter: Fixed potential FileWriter leak in `createWriter` methods if BufferedWriter creation failed.
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