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(server): Filter dynamice path(PUT/GET/DELETE) with params cause OOM #2569

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

Conversation

JackyYangPassion
Copy link
Contributor

@JackyYangPassion JackyYangPassion commented Jul 2, 2024

Purpose of the PR

Main Changes

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • xxx

Does this PR potentially affect the following parts?

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 2, 2024
@dosubot dosubot bot added the bug Something isn't working label Jul 2, 2024
@imbajin
Copy link
Member

imbajin commented Jul 2, 2024

@SunnyBoy-WYH could u take a look for it~

@SunnyBoy-WYH
Copy link
Contributor

can we merge the requestContext.getUriInfo()?

URI uri = requestContext.getUriInfo().getRequestUri();
String path = uri.getRawPath();
String method = requestContext.getMethod();
UriInfo uriInfo = requestContext.getUriInfo();
String path = normalizePath(uriInfo.getPath(),method);
String metricsName = join(path, method);

@SunnyBoy-WYH
Copy link
Contributor

Let’s not talk about the oom for now. for HISTOGRAM metric,seems path without param will be better.? @JackyYangPassion @imbajin

@SunnyBoy-WYH
Copy link
Contributor

As a consult, Do you have oom system log and ensure the oom due to this map?

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 11, 2024
@JackyYangPassion
Copy link
Contributor Author

As a consult, Do you have oom system log and ensure the oom due to this map?

Yes
Correction approach:

1. Determine if there are variable parameters in the request path.
2. If there are, replace the values with keys to normalize the metrics.
3. Special handling for /{graphs}/ to accommodate multi-graph mode.

@imbajin imbajin requested a review from javeme July 11, 2024 09:48
Copy link
Contributor

@SunnyBoy-WYH SunnyBoy-WYH left a comment

Choose a reason for hiding this comment

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

can we del LOG.debug ?

Copy link

codecov bot commented Jul 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Project coverage is 1.31%. Comparing base (37e71c4) to head (bf3bfc3).
Report is 11 commits behind head on master.

Files Patch % Lines
...g/apache/hugegraph/api/filter/AccessLogFilter.java 0.00% 23 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (37e71c4) and HEAD (bf3bfc3). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (37e71c4) HEAD (bf3bfc3)
6 2
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #2569       +/-   ##
============================================
- Coverage     56.42%   1.31%   -55.12%     
+ Complexity      586      30      -556     
============================================
  Files           612     696       +84     
  Lines         49672   55947     +6275     
  Branches       6681    7049      +368     
============================================
- Hits          28029     733    -27296     
- Misses        18833   55161    +36328     
+ Partials       2810      53     -2757     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@imbajin
Copy link
Member

imbajin commented Jul 20, 2024

can we del LOG.debug ?

@SunnyBoy-WYH Thanks, adjust it to trace & use {} format for it, anymore suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] AccessLogFilter for path matrics make Server OOM
3 participants