Ruby mogilefs-client dev/users discussion/patches/bugs/help/...
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] mogilefs-client 3.10.0 - MogileFS client library for Ruby
@ 2016-08-31  7:43  6% Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2016-08-31  7:43 UTC (permalink / raw)
  To: ruby-talk, mogile; +Cc: mogilefs-client-public

A MogileFS client library for Ruby.  MogileFS is an open source
distributed filesystem, see: http://mogilefs.org for more details.  This
library allows any Ruby application to read, write and delete files in a
MogileFS instance.

Changes:

    Ruby mogilefs-client 3.10.0

    A bunch of minor tweaks to reduce garbage and exceptions.

    In addition to the existing :timeout and :fail_timeout options,
    there is a new :connect_timeout directive for all connection
    classes which only controls the time spent waiting for a TCP
    connection.  This defaults to the same value as the existing
    :timeout option (3 seconds); but users are advised to lower
    it to match ideal network conditions.

    For users of Ruby 2.3+, this release takes advantage of
    exception-less Socket#connect_nonblock using "exception: false".
    Users of Ruby 2.1+ will also benefit from "exception: false"
    usage for read_nonblock and write_nonblock calls.
    kgio is no longer be useful with this release with Ruby 2.3+

    This release also fixes a Ruby 1.8.7 compatibility bug for
    non-kgio users.  However, this may be the last 1.8.7-compatible
    release.  Fwiw, I wanted to remove Ruby 1.8 support around 5
    years ago but several users were against it.   Maybe nobody will
    complain, this time...

    18 changes since 3.9.0:

          doc: avoid inadvertantly documenting the Process class
          admin: simplify utilization conversion
          more idiomatic comparisons with constants
          bigfile/filter: only update MD5 if non-nil
          bigfile: lazily require bigfile/filter
          backend: simplify regexp
          .olddoc.yml: add NNTP and mailing list archive URL
          minor garbage reductions for newer Rubies
          socket/pure_ruby: fix Ruby 1.8 compatibility
          socket/pure_ruby: use `:exception=>false' on Ruby 2.1+
          test_fresh: do not delete non-existent domain
          admin: map unset reject_bad_md5 field to nil
          socket/pure_ruby: connect with "exception:false" on Ruby 2.3+
          implement :connect_timeout option
          add .gitattributes for Ruby method detection
          README: stop mentioning cgit
          connect_timeout: match :timeout if unset
          pkg.mk: use --local option for gem installation

rdoc :: http://bogomips.org/mogilefs-client/
list :: mogilefs-client-public@bogomips.org
list-cc :: mogile@googlegroups.com
list-archive :: http://bogomips.org/mogilefs-client-public/
git clone git://bogomips.org/mogilefs-client.git
nntp://news.public-inbox.org/inbox.comp.file-systems.mogilefs.ruby

^ permalink raw reply	[relevance 6%]

* [PATCH 3/6] socket/pure_ruby: connect with "exception:false" on Ruby 2.3+
  2016-08-31  2:50  5% [PATCH 0/6] misc fixes and features Eric Wong
@ 2016-08-31  2:50  7% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2016-08-31  2:50 UTC (permalink / raw)
  To: mogilefs-client-public

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.
---
 lib/mogilefs/socket/pure_ruby.rb | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/lib/mogilefs/socket/pure_ruby.rb b/lib/mogilefs/socket/pure_ruby.rb
index d57a7c0..59e43e1 100644
--- a/lib/mogilefs/socket/pure_ruby.rb
+++ b/lib/mogilefs/socket/pure_ruby.rb
@@ -5,13 +5,21 @@
 class MogileFS::Socket < Socket
   include MogileFS::SocketCommon
 
-  def self.start(host, port)
-    sock = new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
-    begin
-      sock.connect_nonblock(sockaddr_in(port, host))
-    rescue Errno::EINPROGRESS
+  if RUBY_VERSION.to_f >= 2.3
+    def self.start(host, port)
+      sock = new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
+      sock.connect_nonblock(sockaddr_in(port, host), :exception => false)
+      sock.post_init(host, port)
+    end
+  else
+    def self.start(host, port)
+      sock = new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
+      begin
+        sock.connect_nonblock(sockaddr_in(port, host))
+      rescue Errno::EINPROGRESS
+      end
+      sock.post_init(host, port)
     end
-    sock.post_init(host, port)
   end
 
   def self.tcp(host, port, timeout = 5)
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/6] misc fixes and features
@ 2016-08-31  2:50  5% Eric Wong
  2016-08-31  2:50  7% ` [PATCH 3/6] socket/pure_ruby: connect with "exception:false" on Ruby 2.3+ Eric Wong
  0 siblings, 1 reply; 3+ results
From: Eric Wong @ 2016-08-31  2:50 UTC (permalink / raw)
  To: mogilefs-client-public

I mainly wanted to implement :connect_timeout, but ended up with
a bunch of other small improvements along the way.  Will release
soon since it's been a while.

Eric Wong (6):
  test_fresh: do not delete non-existent domain
  admin: map unset reject_bad_md5 field to nil
  socket/pure_ruby: connect with "exception:false" on Ruby 2.3+
  implement :connect_timeout option
  add .gitattributes for Ruby method detection
  README: stop mentioning cgit

 .gitattributes                   |  4 ++++
 README                           |  2 +-
 lib/mogilefs/admin.rb            |  2 ++
 lib/mogilefs/backend.rb          |  3 ++-
 lib/mogilefs/client.rb           |  4 +++-
 lib/mogilefs/mogilefs.rb         |  4 ++++
 lib/mogilefs/socket/pure_ruby.rb | 20 ++++++++++++++------
 test/fresh.rb                    |  2 +-
 test/test_fresh.rb               |  2 +-
 9 files changed, 32 insertions(+), 11 deletions(-)
 create mode 100644 .gitattributes

-- 
EW

^ permalink raw reply	[relevance 5%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-08-31  2:50  5% [PATCH 0/6] misc fixes and features Eric Wong
2016-08-31  2:50  7% ` [PATCH 3/6] socket/pure_ruby: connect with "exception:false" on Ruby 2.3+ Eric Wong
2016-08-31  7:43  6% [ANN] mogilefs-client 3.10.0 - MogileFS client library for Ruby Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/mogilefs-client.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).