Skip to content

Conversation

@halibobo1205
Copy link
Contributor

@halibobo1205 halibobo1205 commented Jun 19, 2024

What does this PR do?
Fix net traffic metric tracking for HTTP: change endpoint variable from member to local.
Why are these changes required?
The class HttpInterceptor is a singleton, so the member field endpoint is shared between users. The single instance is used and re-used to handle multiple requests processed simultaneously by different threads. The result is that one user could see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.
image

The endpoint is used for the HTTP net traffic metric, so this statistic is probably wrong.
image

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

@halibobo1205 halibobo1205 changed the title fix(http/metric): change endpoint variable from member to local fix(http/metric): fix race condition for HTTP net traffic metric tracking Jun 20, 2024
@halibobo1205 halibobo1205 changed the title fix(http/metric): fix race condition for HTTP net traffic metric tracking fix(http/metric): fix race condition for HTTP net traffic metric Jun 20, 2024
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.

4 participants