elixir-plug / plug

Compose web applications with functions
https://hex.pm/packages/plug
Other
2.85k stars 586 forks source link

Plug.Upload: demonitor previous owner when giving away #1203

Closed up2jj closed 8 months ago

up2jj commented 8 months ago

Hi,

When the random file is created, Plug.Upload GenServer starts to monitor the process where random_file/1 was called. I noticed that Plug.Upload.give_away/3 creates the monitor for to_pid but does not demonitor the previous owner (process).

Just out of curiosity, should we be concerned about this somehow, or will the effort to introduce this not result in any increase in efficiency?

josevalim commented 8 months ago

It is completely fine. Plus we don't demonitor in case there are other files associated to the original pid.