darcs

Issue 1231 breaking a pull with C-c leaves temp files in the repo

Title breaking a pull with C-c leaves temp files in the repo
Priority feature Status given-up
Milestone Resolved in
Superseder Nosy List attila.lendvai, darcs-devel, dmitry.kurochkin, kowey, mornfall, thorkilnaur
Assigned To
Topics Control-C, HTTP

Created on 2008-11-18.14:54:02 by attila.lendvai, last changed 2017-07-30.23:35:04 by gh.

Messages
msg6687 (view) Author: attila.lendvai Date: 2008-11-18.14:53:59
files like "darcs28774-new" remain in the root of the repo when darcs is broken
with C-c while pulling.

either store temp files in /tmp/ or maybe inside _darcs/tmp/ which is cleared
every time the directory lock is obtained?
msg6739 (view) Author: thorkilnaur Date: 2008-11-24.16:30:41
Thank you. I guess that this should not happen, but presume that you are able to 
proceed in any case.

Although I seem to remember seeing this on occasion, it certainly doesn't happen 
every time. For example, right now I have tried to reproduce the problem on a 
PPC Mac OS X 10.5 and have not succeeded yet.

Could you please supply some additional details about your case, such as the 
system, you are working on, the darcs version, and perhaps you have also noticed 
the phase of the pull (inventories, patches, and so on) where you have seen 
temporary files that needed to be cleaned up after interrupting with C-c?

Thank you very much and best regards
Thorkil
msg6743 (view) Author: attila.lendvai Date: 2008-11-24.20:08:31
it happens on an Ubuntu 8.10, with darcs stable locally compiled.

checking for libcurl... 7.18.2
checking for curl_global_init in -lcurl... yes
checking for curl_multi_timeout in -lcurl... yes
checking for libcurl pipelining... yes

it probably happens in the phase when a patch is being downloaded. try to 
record a big patch and pull it from a relatively slow remote machine or with 
your network loaded.

$ darcs --version
2.1.0 (+ 348 patches)

but it's been like that at least for several months now.

hth,

 - attila
msg6891 (view) Author: mornfall Date: 2008-12-25.21:50:57
These darcsNNNNN-new files come not from patches, but every time fetchFilePS is 
used, such a file will appear. The code responsible for removing these seems to 
be:
                           then do atexit $ removeFileMayNotExist f_new
in checkWaitToStart in src/URL.hs...

I guess that doesn't work for some reason.

Part of the problem likely is that fetchFilePS will do withTemp to create a 
temporary file, which will be the darcsNNNNN file. However, using the URL 
module on that temporary file will produce a darcsNNNNN-new file and when 
download finishes, move that file over the original darcsNNNNN file.

(Actually, they might come from patched in darcs-1 repositories... I would have 
to investigate more, but am too sleepy...)

Anyway, this all is byproduct of darcs using silly API to download things into 
files that it will just read into memory anyway: fetchFilePS shouldn't produce 
any temporary files whatsoever. One of those rainy days, I'll look into 
refactoring all this networking mess...
msg8092 (view) Author: kowey Date: 2009-08-11.14:51:49
OK, I'm marking this as need-implementation as Petr has a fairly clear idea that
we shouldn't even be creating temporary files in the first place.  All we need
is somebody to do the work (perhaps Petr when he gets a chance)
History
Date User Action Args
2008-11-18 14:54:02attila.lendvaicreate
2008-11-24 16:30:44thorkilnaursetstatus: unread -> unknown
nosy: kowey, dagit, attila.lendvai, simon, thorkilnaur, dmitry.kurochkin
messages: + msg6739
2008-11-24 20:08:35attila.lendvaisetnosy: kowey, dagit, attila.lendvai, simon, thorkilnaur, dmitry.kurochkin
messages: + msg6743
2008-12-25 21:51:01mornfallsetnosy: + mornfall
messages: + msg6891
2009-01-12 12:20:11thorkilnaursettopic: + Control-C
nosy: kowey, dagit, attila.lendvai, simon, thorkilnaur, dmitry.kurochkin, mornfall
2009-08-10 23:51:49adminsetnosy: - dagit
2009-08-11 14:51:53koweysetpriority: bug -> feature
status: unknown -> needs-implementation
messages: + msg8092
nosy: kowey, attila.lendvai, simon, thorkilnaur, dmitry.kurochkin, mornfall
2009-08-17 06:33:41koweysettopic: + HTTP
nosy: kowey, attila.lendvai, simon, thorkilnaur, dmitry.kurochkin, mornfall
2009-08-17 06:35:36koweylinkissue1489 superseder
2009-08-25 17:34:39adminsetnosy: + darcs-devel, - simon
2009-08-27 14:25:09adminsetnosy: kowey, darcs-devel, attila.lendvai, thorkilnaur, dmitry.kurochkin, mornfall
2009-10-23 22:34:47adminsetnosy: + attila_lendvai, - attila.lendvai
2009-10-23 23:48:46adminsetnosy: + attila.lendvai, - attila_lendvai
2010-04-02 14:20:13koweyunlinkissue1489 superseder
2017-07-30 23:35:04ghsetstatus: needs-implementation -> given-up