redis 4.2.4 → 4.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7c23f28cc1a4b66b70d9caf4b890ce521145a51435921e65d5676ce7145c2bf
4
- data.tar.gz: b88ecef94de49b0419ed1e1152fc05b5a6999a53883235b09b2eef0df3d37d9c
3
+ metadata.gz: 862e8133262fead707e4ca317b29d0e35425e3a7861ea1a52033bc91ba61bf6d
4
+ data.tar.gz: 5b2b32250d783fe58b0af54cc386f2568241644a0badc0b7247bb29b1ac94a93
5
5
  SHA512:
6
- metadata.gz: 4904a1b642fe757601a0c3bb34cb1d1160ca6bdf269624ae73a9d73599c11ad2d8e52a93ba1396bd76c71f31456211d7332d3c8fa16dd44d2ceb92826cbe86cc
7
- data.tar.gz: d491bf50bca0c804d1b594ebf2de1d5b5a1d464873fe0d03986464006638028e7dd2b2056ed24919bb70a8c60c9a9fabf0e73663e8065bd474baf52abbf95d98
6
+ metadata.gz: 2aab289f4f22b2f3a804ca7b0da4cf95e352a8d246611490d8d803edebbbc7e7c299355cd0b90e6f3ac8bc0d11e9bf3792a328c95847d32e1d984729afe66ed2
7
+ data.tar.gz: d9ec8ba4d314d099e909cdddf6dfb4c3c14b853b46f45c4909ac3ba10fb1880bd9a7b0465257fa91f9a4ea6c9f82723c16c177810ac15c89fab3790d7af31ad0
@@ -1,5 +1,9 @@
1
1
  # Unreleased
2
2
 
3
+ # 4.2.5
4
+
5
+ * Optimize the ruby connector write buffering. See #964.
6
+
3
7
  # 4.2.4
4
8
 
5
9
  * Fix bytesize calculations in the ruby connector, and work on a copy of the buffer. Fix #961, #962.
@@ -67,10 +67,13 @@ class Redis
67
67
  end
68
68
  end
69
69
 
70
- def _write_to_socket(data)
70
+ def write(buffer)
71
+ return super(buffer) unless @write_timeout
72
+
73
+ bytes_to_write = buffer.bytesize
71
74
  total_bytes_written = 0
72
75
  loop do
73
- case bytes_written = write_nonblock(data, exception: false)
76
+ case bytes_written = write_nonblock(buffer, exception: false)
74
77
  when :wait_readable
75
78
  unless wait_readable(@write_timeout)
76
79
  raise Redis::TimeoutError
@@ -83,28 +86,13 @@ class Redis
83
86
  raise Errno::ECONNRESET
84
87
  when Integer
85
88
  total_bytes_written += bytes_written
86
- if bytes_written < data.bytesize
87
- data.slice!(0, bytes_written)
88
- else
89
+
90
+ if total_bytes_written >= bytes_to_write
89
91
  return total_bytes_written
90
92
  end
91
- end
92
- end
93
- end
94
93
 
95
- def write(data)
96
- return super(data) unless @write_timeout
97
-
98
- data = data.b
99
- length = data.bytesize
100
- total_count = 0
101
- loop do
102
- count = _write_to_socket(data)
103
-
104
- total_count += count
105
- return total_count if total_count >= length
106
-
107
- data = data.byteslice(count..-1)
94
+ buffer = buffer.byteslice(bytes_written..-1)
95
+ end
108
96
  end
109
97
  end
110
98
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Redis
4
- VERSION = '4.2.4'
4
+ VERSION = '4.2.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.4
4
+ version: 4.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2020-11-19 00:00:00.000000000 Z
19
+ date: 2020-11-20 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: em-synchrony
@@ -102,9 +102,9 @@ licenses:
102
102
  metadata:
103
103
  bug_tracker_uri: https://github.com/redis/redis-rb/issues
104
104
  changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
105
- documentation_uri: https://www.rubydoc.info/gems/redis/4.2.4
105
+ documentation_uri: https://www.rubydoc.info/gems/redis/4.2.5
106
106
  homepage_uri: https://github.com/redis/redis-rb
107
- source_code_uri: https://github.com/redis/redis-rb/tree/v4.2.4
107
+ source_code_uri: https://github.com/redis/redis-rb/tree/v4.2.5
108
108
  post_install_message:
109
109
  rdoc_options: []
110
110
  require_paths: