patchmldonkey, a multi-networks file-sharing client - Patches: patch #4917, HDD space check

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4917: HDD space check

Submitter:  spiralvoice <spiralvoice>
Submitted:  Fri 17 Feb 2006 01:59:26 PM UTC
   
 
Category:  Improved interfaces Priority:  5 - Normal
Status:  Done Assigned to:  None
Open/Closed:  Closed

Jump to the original submission

Sun 19 Mar 2006 05:38:16 PM UTC, comment #16: 

Applied 2006/03/19

spiralvoice <spiralvoice>
Group administrator
Sun 19 Mar 2006 05:28:47 PM UTC, comment #15: 

updated patch, removed the log_file weirdnesses, now logging
is redirected to RAM when log_dir partition is full, nothing
more, npthing less.

Logging mechanism needs some major restructuring.

spiralvoice <spiralvoice>
Group administrator
Mon 06 Mar 2006 06:20:37 PM UTC, comment #14: 

One more parameter: incoming_files ~user ~freespace ~network ()

~network will implement (optional) network specific commit dirs

spiralvoice <spiralvoice>
Group administrator
Mon 06 Mar 2006 06:19:34 PM UTC, comment #13: 

TODO: Iter shared_directories for incoming dirs with enough free space if the first choice is full.

^^ This will be part of the multiuser patch, incoming_files ()
will get parameters ~user ~freespace and return an appropiate directory.

spiralvoice <spiralvoice>
Group administrator
Tue 28 Feb 2006 02:04:04 PM UTC, comment #12: 

TODO: Iter shared_directories for incoming dirs with enough free space if the first choice is full.

spiralvoice <spiralvoice>
Group administrator
Mon 27 Feb 2006 03:00:07 AM UTC, comment #11: 

updated patch, please test - should be final version

- deactivate logging when core basedir is full (redirect log to internal log in RAM, max !!log_size lines)

spiralvoice <spiralvoice>
Group administrator
Mon 20 Feb 2006 01:36:35 AM UTC, comment #10: 

updated force_download_quotas () function, thx to pango

spiralvoice <spiralvoice>
Group administrator
Sun 19 Feb 2006 01:29:12 AM UTC, comment #9: 

updated patch

  • deactivate ini file saving if core base_dir is full and hdd_coredir_stop_core is false
  • reactivate config_file_space.tmp
spiralvoice <spiralvoice>
Group administrator
Sun 19 Feb 2006 12:02:36 AM UTC, comment #8: 

updated patch

  • some internal optimizations thx to pango
  • files are now queued, not paused when temp_directory is full
spiralvoice <spiralvoice>
Group administrator
Sat 18 Feb 2006 07:48:11 PM UTC, comment #7: 

Updated patch

  • implemented incoming_dir space check during commit
  • implemented old style GUI console warning


TO-DO:

  • deactivate logging when all downloads are paused (redirect log to internal log in RAM)
  • deactivate ini files saving if !!hdd_coredir_stop_core false (+ warning mail, log, GUI message)


  • if temp dir is full and hdd_temp_stop_core false,

save !!max_concurrent_downloads somewhere, lower it to zero and
call force_download_quotas () (this queues downloading files)
instead of pausing all files. If more space on temp dir is
available again restore the old value of !!max_concurrent_downloads
and call force_download_quotas () (this de-queues queued files).
This will preserve already paused downloads and relieve the user
from manually restarting the downloads.

spiralvoice <spiralvoice>
Group administrator
Fri 17 Feb 2006 10:46:35 PM UTC, comment #6: 

st_dev works on MinGW, good

spiralvoice <spiralvoice>
Group administrator
Fri 17 Feb 2006 10:20:31 PM UTC, comment #5: 

"If it doesn't shut down, and you also don't use the config_files_space.tmp, what will happen to config file saving during the time the disk space is too low to save them?"
They will get corrupt.

"Use both? Disable config saving if disk space is too low while the core is running, except always save at shutdown as it can then remove the c_f_s.tmp file?"
Good idea, saving backups and logging should also be deactivated
during core run. A warning mail will be sent to inform the user
that saving config data is disabled, also sent to the GUI.
What about using this new structure for this important GUI message?

4860: Multiuser: print warning if admin password is empty
- create structure for startup messages, displayed on GUI, HTML, Telnet

commonOptions:
let startup_message = ref ""

I am thinking about displaying this message as a popup in GUI
so users will notice it.

Regarding the commit problem I will try if st_dev works on all platforms supported by MLDonkey.

spiralvoice <spiralvoice>
Group administrator
Fri 17 Feb 2006 10:18:31 PM UTC, comment #4: 

Updated patch, now core shutdown can be deactivated and the email
interval is configurable. Currently supported options with their defaults:

hdd_temp_minfree 50
Mininum free space in MB on temp_directory, minimum 50

hdd_temp_stop_core false
If true core shuts down when free space on temp dir is below hdd_temp_minfree, otherwise all downloads are paused and a warning email is sent.

let hdd_coredir_minfree 50
Mininum free space in MB on core directory, minimum 20

hdd_coredir_stop_core true
If true core shuts down when free space on core dir is below hdd_coredir_minfree, otherwise all downloads are paused and a warning email is sent.

hdd_send_warning_interval 1
Send a warning mail each <interval> hours for each directory, 0 to deactivate mail warnings.

spiralvoice <spiralvoice>
Group administrator
Fri 17 Feb 2006 06:28:18 PM UTC, comment #3: 


> Having an option whether to shutdown the core if core_dir diskspace
> is too low is no problem.


If it doesn't shut down, and you also don't use the config_files_space.tmp, what will happen to config file saving during the time the disk space is too low to save them? 

Use both? Disable config saving if disk space is too low while the core is running, except always save at shutdown as it can then remove the c_f_s.tmp file?


> The only idea I have is to compare total and free disk space on
> !!temp_directory and incoming directory.
> Is it save to assume that when these values match both dirs are
> on the same partition?


If you "stat" the two directories and they return the same st_dev (device #), I think they will be on the same partition. (see "man 2 stat").

z <zet>
Group Member
Fri 17 Feb 2006 05:32:59 PM UTC, comment #2: 

The patch is not finished yet, I put it here for discussion.
I am planing to send warning e-mails in a user-configurable interval (default one hour after the first e-mail).

"but that is why the config_files_space.tmp was used"
True, but the diskspace config_files_space.tmp occupies is only
released before saving ini files on core shutdown. During core run
saving ini files happens without removing config_files_space.tmp first.
I think (untested) that removing config_files_space.tmp before
each saving of ini files and to re-create it afterwards will block
the core for some time. Saving of ini files is not threaded...

Having an option whether to shutdown the core if core_dir diskspace
is too low is no problem.

Also I want to code a check in CommonInteractive.file_commit if
diskspace on incoming dir is big enough to commit a file. If not,
the file will stay in the commit queue. The only problem I am
seeing is how to determine if !!temp_directory and incoming_dir
are on the same physical partition, in this case commit means
move which is unproblematic in regard of free diskspace.

The only idea I have is to compare total and free disk space on
!!temp_directory and incoming directory.
Is it save to assume that when these values match both dirs are
on the same partition?

spiralvoice <spiralvoice>
Group administrator
Fri 17 Feb 2006 03:43:34 PM UTC, comment #1: 

1. If hdd_check runs every minute, won't it be flooding my mailbox if a disk is full and all files paused? That is a lot of mail if I'm on vacation.

2.

+  if dir_full core_dir 30 then
+    begin
+      send_warning !!temp_directory "MLDonkey base directory partition full, shutting down...";
+      CommonInteractive.clean_exit 0
+    end;


If I am moving files around in another session and my core_dir is temporarily 25 megs, why should mldonkey exit, if a minute later the files are gone and a gig is free?  I don't think mldonkey should ever exit on its own (unless specifically configured to do so).  I might be on vacation and want uploads to continue -- downloading might not be important to me.  Finding the core stopped on its own seems like a bug.

I know that you are worried about space for saving config files, but that is why the config_files_space.tmp was used.  I don't think a timer running every minute is as conceptually strong as having reserved space that is used at the moment the config files need it.

z <zet>
Group Member
Fri 17 Feb 2006 01:59:26 PM UTC, original submission:  


spiralvoice <spiralvoice>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #9652:  4917_3.patch added by spiralvoice (18KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 25 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-03-19 spiralvoice StatusNone Done
    Open/ClosedOpen Closed
2006-03-19 spiralvoice Attached File- Added 4917_3.patch, #6063
2006-03-19 spiralvoice Attached File#6017 Removed
2006-03-06 spiralvoice Attached File- Added 4917.patch, #6017
2006-03-06 spiralvoice Attached File#5991 Removed
2006-02-27 spiralvoice Attached File- Added 4917.patch, #5991
2006-02-27 spiralvoice Attached File#5979 Removed
2006-02-22 spiralvoice Attached File- Added hdd_check.patch, #5979
2006-02-22 spiralvoice Attached File#5967 Removed
2006-02-20 spiralvoice Attached File- Added hdd_check.patch, #5967
2006-02-20 spiralvoice Attached File#5961 Removed
2006-02-19 spiralvoice Attached File- Added hdd_check.patch, #5961
2006-02-19 spiralvoice Attached File#5960 Removed
2006-02-19 spiralvoice Attached File- Added hdd_check.patch, #5960
2006-02-19 spiralvoice Attached File#5959 Removed
2006-02-19 spiralvoice Attached File- Added hdd_check.patch, #5959
2006-02-19 spiralvoice Attached File#5958 Removed
2006-02-19 spiralvoice Attached File- Added hdd_check.patch, #5958
2006-02-19 spiralvoice Attached File#5957 Removed
2006-02-18 spiralvoice Attached File- Added hdd_check.patch, #5957
2006-02-18 spiralvoice Attached File#5953 Removed
2006-02-18 spiralvoice Attached File- Added hdd_check.patch, #5953
2006-02-18 spiralvoice Attached File#5952 Removed
2006-02-17 spiralvoice Attached File- Added hdd_check.patch, #5952

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code