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

Jaeger cleantempfiles #90

Merged
merged 2 commits into from
Mar 1, 2023
Merged

Conversation

aldas
Copy link
Contributor

@aldas aldas commented Mar 1, 2023

See: labstack/echo#2413


alright, to summarize this situation:

we are leaking temporary files because when jaegertracing replaces original Request object with new one with its span added to the context.Context.

			req = req.WithContext(opentracing.ContextWithSpan(req.Context(), sp))
			c.SetRequest(req)

problem with that is when c.FormValue or c.FormFile is used in handler (upload) that new Request object parses multipartform object. Creates new temporary file and sets form as it field.

now these temporary form files are cleaned up at the end of the request by go standard library HERE but http server does not have access to that new Request object - it still works on that old Request object that does not have parsed form, therefore does not know anything about temporary files.


problem must be fixed where it is introduced. - jaegertracing middleware must clean multipartform files at the end of its lifecycle.

@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Patch coverage: 75.00% and project coverage change: +0.04 🎉

Comparison is base (5bb0f68) 58.79% compared to head (8ed8dca) 58.84%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #90      +/-   ##
==========================================
+ Coverage   58.79%   58.84%   +0.04%     
==========================================
  Files           8        8              
  Lines         682      690       +8     
==========================================
+ Hits          401      406       +5     
- Misses        258      260       +2     
- Partials       23       24       +1     
Impacted Files Coverage Δ
jaegertracing/jaegertracing.go 56.37% <75.00%> (+0.25%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@aldas aldas merged commit b6855c2 into labstack:master Mar 1, 2023
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.

None yet

1 participant