Commit Graph

526 Commits

Author SHA1 Message Date
arvidn b0daa69aa8 when stopping torrents, only abort hash jobs from a full check. Those jobs are likely to have deep queues and to benefit from being cancelled. Other hash jobs from downloading pieces cannot be restarted and should not be cancelled 2020-05-05 01:17:05 +02:00
arvidn d08fa164d2 fix issue where pieces would be hashed despite disable_hash_checks was set 2019-09-13 22:38:18 +02:00
arvidn a3440e54bb make aux::session_settings thread-safe. this allows all threads to share the same settings object, which has low contention and is rarely updated 2019-09-01 03:41:36 +02:00
arvidn 3a093c5d27 improve disk I/O logging 2019-03-28 12:00:32 +01:00
arvidn 102387f4a8 make all tests run cleanly with leak sanitizer 2019-03-27 17:10:36 +01:00
Steven Siloti 4dc2e6015d use flag to prevent multiple calls to abort_jobs even when asserts are disabled 2019-03-26 18:04:18 +01:00
Steven Siloti 8d9c746149 always flush disk I/O job queue before shutdown
Leaving jobs on the queue can lead to memory leaks
2019-03-26 18:04:18 +01:00
Arvid Norberg 19dbfce9c0 simplify and clean up the handling of name in internal_file_entry. move should be more efficient now, by not copying the name 2019-03-22 21:31:32 +01:00
arvidn 9bd5f424d3 use standard __func__ identifier instead of extensions 2019-02-26 23:59:43 +01:00
arvidn 4473a8d0ce fix seed_mode flag 2019-02-24 10:20:20 +01:00
Steven Siloti d33b0506a0 don't try to hash empty read in do_uncached_hash 2019-02-11 10:38:28 +01:00
arvidn 072563c973 add asserts in disk_fence_job 2018-12-07 13:37:27 +01:00
arvidn 5383854768 make span's and sha1_hash's index and size types signed (instead of unsigned). Specifically std::ptrdiff_t. In line with the direction of gsl span and reduce signed->unsigned casts 2018-11-16 14:06:22 +01:00
arvidn 78a344bd8b merged RC_1_1 into master 2018-09-05 08:25:14 -07:00
Arvid Norberg 51003d11ca add assert to storage 2018-09-04 13:44:24 +02:00
arvidn 55215742af merged RC_1_1 into master 2018-08-25 14:13:51 +02:00
Arvid Norberg 6e80f1f615 improve handling of filesystems not supporting fallocate() 2018-08-22 08:35:22 +02:00
Alden Torres 6a13d14f11 more use of const modifier 2018-08-15 07:41:41 +02:00
arvidn c426ba88d4 fix buffer offset bug recently introduced to disk_io_thread::do_read() 2018-08-06 13:16:41 +02:00
arvidn 5f7252b32b add missing increment of on_disk_counter and num_blocks_hashed counters 2018-08-02 23:15:00 +02:00
arvidn 2ba0e5ae2c move the file priority vector throught the disk_io_job, to avoid copies 2018-07-08 18:25:06 +02:00
d-komarov 6d5a6f05ad Fix torrent files prioritization (#3133)
After setting file priority, any subsequent attempt to set different priorities will fail if there is a `file_priority` job running in in disk thread. This happens because `torrent::m_file_priority` is being updated before adding disk thread job. The problem is gone if the file priority vector owned by the torrent object, is modified in the `torrent::on_file_priority` callback, when disk job finishes.
2018-07-04 08:16:33 +02:00
Alden Torres be78a43d05 more use of empty(), emplace_back, const and auto in disk_io_thread code 2018-06-24 07:02:17 +02:00
arvidn 2cb29f88ac merged RC_1_1 into master 2018-06-23 23:22:26 +02:00
Steven Siloti b7f230316c set the minimum number of checking jobs based on the number of hasher threads
To effectively mask the latency of generating more hash jobs there need to be
at least two jobs in-flight for each hasher thread.
2018-06-23 23:10:55 +02:00
arvidn 1e3a7cf0f4 fix hash-job fast-path 2018-06-23 23:08:58 +02:00
arvidn 7ca769884c merged RC_1_1 into master 2018-06-22 08:33:44 +02:00
arvidn 0c147164bc introduce a fast-path for the hash disk job 2018-06-20 01:00:16 +02:00
arvidn e7fe7f1b89 fix boost::get<> invocation for variant 2018-06-10 00:56:55 +02:00
Alden Torres a357e490ed minor code refactor, more use of auto 2018-06-08 21:56:06 +02:00
Arvid Norberg 794ccf4f79 remove unused disk stats counters 2018-06-05 19:03:04 +02:00
arvidn 267ca40b28 merged RC_1_1 into master 2018-06-02 13:15:13 +02:00
arvidn c55bc7dd42 improve error handling of failing to change file priority 2018-05-31 00:47:17 +02:00
arvidn fe612ca167 replace the TORRENT_CFG ABI check with inline namespaces around the symbol that can change ABI based on build configuration options 2018-05-13 19:25:17 +02:00
arvidn 299a545648 add test for suggests- and seed mode combined 2018-05-10 17:40:23 +02:00
arvidn 8621477239 merged RC_1_1 into master 2018-04-28 14:36:24 +02:00
Steven Siloti f5e33932d2 fix use after free in flush_range and flush_iovec
Calling blocks_flushed can cause the piece entry to be freed so its
callers need to be aware of that and avoid dereferencing the pointer if
the entry is freed.
2018-04-27 16:15:19 +02:00
Alden Torres 0ec66e9024 fix disk_io_thread::do_check_fastresume storage initialize logic from RC_1_1 merge 2018-04-25 16:04:20 -04:00
Xiyue Deng 21d8e9e26b Add missing header <cstdarg> for va_list.
* Fix building on OpenBSD.
2018-04-24 23:09:25 -04:00
Arvid Norberg d8c022070f merged RC_1_1 into master 2018-04-21 17:17:55 -04:00
arvidn f0227451a6 merged RC_1_1 into master 2018-04-13 01:47:41 +02:00
arvidn aaf9304a3b update year in copyright header 2018-04-09 09:04:33 +02:00
Alden Torres d6edf26e11 minor code tidy 2018-04-07 00:30:36 +02:00
gubatron 2a82bb5880 disk_io_thread abort_hash_jobs duplicate code refactor 2018-04-05 16:01:30 +02:00
arvidn 9df4d4b7f8 replace typedef with using. replace NULL with nullptr. cleanup page_aligned_allocator 2018-03-23 11:19:46 +01:00
arvidn a0a63341c7 fix haiku build 2018-02-04 19:10:43 +01:00
arvidn 3a9861e237 complete the error handling test and make it part of the default simulation test suite. It will run a file transfer between two clients repeatedly, each time cause another memory allocation fail, until every single memory allocation has failed once. Any invariant check failure, assertion or signal will cause the test to fail 2018-01-08 04:44:52 -05:00
arvidn 0731200149 block_size is a constant, no need in passing it around as a variable 2018-01-03 08:45:25 -05:00
arvidn c3bdc6f825 use an intrusive linked list for peer_cache_entry instead an unordered set, to avoid heap allocations and make cache operations not able to fail. This simplifies error handling 2017-12-28 00:52:09 +01:00
Alden Torres c97bd53cde more use of const, emplace_back and minor code refactor 2017-11-20 23:45:41 +01:00