Date | Commit message (Collapse) |
|
Not sure how or why I missed these with commit 4e0f8155a62711ae
("fix indentation warnings with ruby trunk"), but this cleans
them up.
|
|
Ruby 2.7.0dev will warn about hashes uses as kwargs *sigh*
|
|
Ruby trunk started warning about more mismatched indentations
starting around r62836.
|
|
String#replace keeps garbage around a bit longer,
so it's not always the better option.
cf. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/86983
https://public-inbox.org/ruby-core/20180511033641.GA4459@dcvr/
|
|
oops :x
|
|
This should compile to smaller bytecode with YARV
|
|
Due to the release of Ruby 2.4.1 with the necessary fix,
it seems likely that future releases (if any) of the 2.2
and 2.3 series will avoid garbage on IO#write, too.
|
|
There's no variable interpolation for the regexp.
|
|
It looks like Ruby 2.4.1 will have the regression fixed
backported to it:
https://bugs.ruby-lang.org/issues/13299#change-63503
The next releases of Ruby 2.3 and 2.2 may, too; at the
branch maintainer's decision.
|
|
On reading more carefully, it seems this change is from
r34847 which landed in Ruby 2.0. So we still need to support
Ruby 2.0 and 2.1 users.
|
|
This should reduce the amount of garbage we produce and
keep the process leaner and meaner.
|
|
It looks like this regression will be fixed in time for
Ruby 2.5.
|
|
This is a workaround for <https://bugs.ruby-lang.org/issues/13085>
since we use non-blocking sockets anyways.
|
|
The optional net-http-persistent RubyGem we use has a major
incompatible change from the 2.x versions. Support them both.
|
|
This compiles to smaller bytecode on YARV (MRI)
|
|
None of these are too performance critical, but err on
the safe side and avoid allocations whenever possible.
|
|
We do not emit any sort of message on successful 2XX responses,
so there's no need to save the actual response after writing.
|
|
And add some weak tests while we're at it.
Actually simulating a connection timeout on localhost
will be difficult.
|
|
This can be useful for specifying a different timeout for
establishing a connection. Some requests could be expensive and
want a higher :timeout measured in seconds, while the time to
establish a TCP connection on a healthy LAN could be less than
a millisecond.
This defaults to 3s to match the existing :timeout, but only
affects the amount of time the client will wait for establishing
a TCP connection to a tracker.
|
|
Exceptions are expensive for common errors, so avoid raising
them under Ruby 2.3+ which allows connect_nonblock to be
called with "exception: false" kwarg.
|
|
The 'reject_bad_md5' field may be of an unknown value
before the monitor is ready, so prepare for it and map
it to 'nil' instead of an empty string. This hopefully
makes the Ruby API more Ruby-ish.
|
|
This feature allows us to avoid expensive exceptions when doing
non-blocking I/O without relying on horrible hacks like kgio.
|
|
For non-kgio users, IO#wait_readable did not appear until Ruby 2.0.
Additionally, optimistically perform reads before waiting because
EOF handling behavior differs in current revisions of Ruby 2.3.0dev.
|
|
opt_str_freeze and String#split is optimized for single-byte splits.
Use bang methods for escaping, avoiding much garbage in tight
loops.
|
|
We don't care if there's a \r before \n if we anchor on \z.
|
|
None of the bigfile stuff is in common use, so avoid bloating
user apps with more of it.
|
|
It is possible to disable MD5 verification, so we cannot risk
updating a nil object.
Also, favor explicitly calling "update" instead of using "<<" which
YARV will attempt to optimize for Array/String receivers at the cost
of other objects (such as Digest::MD5)
|
|
These generates smaller bytecode than explicitly
comparing to a constant value.
|
|
The tracker won't send a utilization field until it has
that data.
|
|
IO#wait_*able methods may use the more efficient ppoll syscall under
Linux to avoid performance penalties with high-numbered FDs. Use
them if available. IO#wait_readable has been around since the 1.8
days at least, and IO#wait_writable was added in Ruby 2.0.0
|
|
This needlessly wastes bytecode and saves around 2K memory
on 64-bit platforms.
|
|
The monotonic clock is immune to discontinuous time jumps while
still taking into account clock imperfections, making it appropriate
for calculating time differences and timeouts.
|
|
This is a deprecated call anyways and no longer supported
by modern versions of the server, so avoid wasting RAM with it.
We will remove this in 4.x
|
|
This adds the reject_bad_md5 and utilization fields.
While we're at it, be more explicit with mapping and
avoid creating an unnecessary hash.
|
|
Our code integerizes certain results nowadays, so update
the documentation to match.
|
|
This caused NameError failures when we ran out of file descriptors.
|
|
This allows easy iteration while respecting :after and :limit.
This gives each_key an interface consistent with each_file_info.
|
|
Note: this mysql component is still largely unmaintained.
|
|
This bug was only introduced in
commit 3c73f6b434a4c226c09e31c6ba3b034cb314b3fb
|
|
In single tracker configurations, a restarted tracker may cause
send()/write() failure on the TCP socket. Retry immediately in
this case, since there's no danger even for non-idempotent
tracker requests.
|
|
It's a small waste and adds to visual noise.
|
|
Avoid needless encoding and data transfer to the tracker.
|
|
We now have separate Net::HTTP::Persistent instances
between clients that may have different timeouts and
also between GET and PUT requests. This hurts our
ability to reuse sockets, but correctness is probably
more important.
|
|
This lets us send unsupported/new arguments to plugins
and matches the functionality of the Perl client library.
|
|
It's possible for networks and servers to break up
even small HTTP headers. We also better enforce the
timeout if we too too long to write the request.
|
|
We don't need to set socket keepalive until we've successfully
written the request out and are awaiting a response.
|
|
Given StringIO objects are already in memory, NHP can make
small uploads which fit into memory faster. Large uploads
(using big_io or :largefile => :stream still go through
IO.copy_stream for now)
|
|
This allows clients to avoid calling #file_info or #get_uris
immediate after uploading a file to MogileFS. This can speed
things up for cache-using clients with write-through caching.
|
|
Array#pop is faster than Array#shift in most Ruby versions
as the latter may require memmove() of all elements.
Additionally, ensure ordering is correct if a backend
chokes up (for each_file_info, too).
|
|
This allows fast listing of keys and metadata (length,
checksum, devcount, class).
|