ilios 1.0.2 → 1.0.3
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 +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile +1 -0
- data/ext/ilios/cluster.c +1 -1
- data/ext/ilios/extconf.rb +11 -16
- data/ext/ilios/future.c +30 -10
- data/ext/ilios/ilios.c +2 -0
- data/ext/ilios/ilios.h +2 -1
- data/ext/ilios/nogvl.c +10 -1
- data/ext/ilios/session.c +2 -2
- data/lib/ilios/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb2abef9a9a501e9a070743ccf92ed53d9bd216fff56022506293ca2ca4d7786
|
|
4
|
+
data.tar.gz: b597a82ffc531bcb6ac74a8e28994210a6455b9640944e4f75223d3419e55590
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a804a3079851d162a2e6bb1811a801c3f1fd2c3f31bbdfd87754cd5c879b06457726b3f9e6e2486ef2c82c7afdab588f57741f12b1893ea42228edcdeb07151
|
|
7
|
+
data.tar.gz: 9b330372c0499631c10f9f79a79f0d8a29f48ebefc46fe440da2c0c345193bb3e62dc508ac185d29593684659ff5fb410f60436c4fc8ad4d7cbff4c41dd6b62d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
- Return 0 from ilios_malloc_size when no size API is available
|
|
6
|
+
- Add proper unblock function for nogvl_sem_wait
|
|
7
|
+
- Register thread-pool slots with GC only once
|
|
8
|
+
- Guard future callback dispatch against double invocation
|
|
9
|
+
- Use write barriers when mutating WB_PROTECTED structs
|
|
10
|
+
- Retain Statement object in async execute future
|
|
11
|
+
- Update libuv to v1.52.1 (#22)
|
|
12
|
+
- Remove unnecessary parentheses
|
|
13
|
+
- Remove extconf_compile_commands_json from runtime dependency
|
|
14
|
+
- Revert "Fix build error with -c++11-extensions"
|
|
15
|
+
- Revert "Disable -Werror on macOS"
|
|
16
|
+
- Disable -Werror on macOS
|
|
17
|
+
- Fix build error with -c++11-extensions
|
|
18
|
+
- Add workaround to avoid build error on macOS
|
|
19
|
+
- Use extconf_compile_commands_json gem for clangd LSP
|
|
20
|
+
|
|
3
21
|
## 1.0.2
|
|
4
22
|
|
|
5
23
|
- Fix install error with CMake 4.x
|
data/Gemfile
CHANGED
data/ext/ilios/cluster.c
CHANGED
|
@@ -132,7 +132,7 @@ static VALUE cluster_keyspace(VALUE self, VALUE keyspace)
|
|
|
132
132
|
StringValue(keyspace);
|
|
133
133
|
|
|
134
134
|
GET_CLUSTER(self, cassandra_cluster);
|
|
135
|
-
cassandra_cluster->keyspace
|
|
135
|
+
RB_OBJ_WRITE(self, &cassandra_cluster->keyspace, keyspace);
|
|
136
136
|
|
|
137
137
|
return self;
|
|
138
138
|
}
|
data/ext/ilios/extconf.rb
CHANGED
|
@@ -5,25 +5,11 @@ require 'etc'
|
|
|
5
5
|
require 'fileutils'
|
|
6
6
|
require 'mini_portile2'
|
|
7
7
|
require 'mkmf'
|
|
8
|
+
require 'rbconfig'
|
|
8
9
|
|
|
9
10
|
have_func('malloc_usable_size')
|
|
10
11
|
have_func('malloc_size')
|
|
11
12
|
|
|
12
|
-
def create_compile_flags_txt
|
|
13
|
-
cppflags = $CPPFLAGS.split
|
|
14
|
-
include_flags = cppflags.select { |flag| flag.start_with?('-I') }
|
|
15
|
-
define_flags = cppflags.select { |flag| flag.start_with?('-D') } + $defs
|
|
16
|
-
|
|
17
|
-
File.open('compile_flags.txt', 'w') do |f|
|
|
18
|
-
include_flags.each { |flag| f.puts(flag) }
|
|
19
|
-
f.puts("-I#{Dir.pwd}")
|
|
20
|
-
f.puts("-I#{RbConfig::CONFIG['rubyhdrdir']}")
|
|
21
|
-
f.puts("-I#{RbConfig::CONFIG['rubyhdrdir']}/ruby/backward")
|
|
22
|
-
f.puts("-I#{RbConfig::CONFIG['rubyarchhdrdir']}")
|
|
23
|
-
define_flags.each { |flag| f.puts(flag) }
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
13
|
module LibuvInstaller
|
|
28
14
|
LIBUV_INSTALL_PATH = File.expand_path('libuv')
|
|
29
15
|
private_constant :LIBUV_INSTALL_PATH
|
|
@@ -90,6 +76,10 @@ module CassandraDriverInstaller
|
|
|
90
76
|
def cmake_compile_flags
|
|
91
77
|
flags = super
|
|
92
78
|
flags << "-DCMAKE_POLICY_VERSION_MINIMUM='3.5'"
|
|
79
|
+
# Avoid "Unsupported compiler: AppleClang" on macOS
|
|
80
|
+
flags << '-DCMAKE_CXX_COMPILER_ID=Clang' if RUBY_PLATFORM.include?('darwin') && RbConfig::CONFIG['CC'].include?('clang')
|
|
81
|
+
|
|
82
|
+
flags
|
|
93
83
|
end
|
|
94
84
|
end
|
|
95
85
|
|
|
@@ -153,4 +143,9 @@ $CPPFLAGS += " #{ENV['CPPFLAGS']}"
|
|
|
153
143
|
$LDFLAGS += " #{ENV['LDFLAGS']}"
|
|
154
144
|
|
|
155
145
|
create_makefile('ilios')
|
|
156
|
-
|
|
146
|
+
|
|
147
|
+
begin
|
|
148
|
+
require 'extconf_compile_commands_json'
|
|
149
|
+
ExtconfCompileCommandsJson.generate!
|
|
150
|
+
rescue LoadError
|
|
151
|
+
end
|
data/ext/ilios/future.c
CHANGED
|
@@ -34,6 +34,13 @@ static void future_thread_pool_init(future_thread_pool *pool)
|
|
|
34
34
|
{
|
|
35
35
|
pool->queue = rb_funcall(cSizedQueue, id_new, 1, INT2NUM(QUEUE_MAX));
|
|
36
36
|
rb_gc_register_mark_object(pool->queue);
|
|
37
|
+
|
|
38
|
+
// Register each slot once. The slots stay zero (Qfalse) until a thread is
|
|
39
|
+
// assigned; re-registering on every thread (re)creation would leak entries
|
|
40
|
+
// in the global address list.
|
|
41
|
+
for (int i = 0; i < THREAD_MAX; i++) {
|
|
42
|
+
rb_gc_register_address(&pool->thread[i]);
|
|
43
|
+
}
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
static void future_thread_pool_prepare_thread(future_thread_pool *pool)
|
|
@@ -49,7 +56,6 @@ static void future_thread_pool_prepare_thread(future_thread_pool *pool)
|
|
|
49
56
|
if (!pool->thread[i] || !RTEST(status)) {
|
|
50
57
|
pool->thread[i] = rb_thread_create(future_result_yielder_thread, (void*)pool);
|
|
51
58
|
rb_funcall(pool->thread[i], id_report_on_exception, 1, Qtrue);
|
|
52
|
-
rb_gc_register_address(&pool->thread[i]);
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
61
|
}
|
|
@@ -136,10 +142,18 @@ static VALUE future_result_yielder_synchronize(VALUE future)
|
|
|
136
142
|
|
|
137
143
|
GET_FUTURE(future, cassandra_future);
|
|
138
144
|
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
if (!cassandra_future->yielded) {
|
|
146
|
+
if (cass_future_error_code(cassandra_future->future) == CASS_OK) {
|
|
147
|
+
if (cassandra_future->on_success_block) {
|
|
148
|
+
cassandra_future->yielded = true;
|
|
149
|
+
future_result_success_yield(cassandra_future);
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
if (cassandra_future->on_failure_block) {
|
|
153
|
+
cassandra_future->yielded = true;
|
|
154
|
+
future_result_failure_yield(cassandra_future);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
143
157
|
}
|
|
144
158
|
cassandra_future->already_waited = true;
|
|
145
159
|
return Qnil;
|
|
@@ -180,7 +194,7 @@ static VALUE future_result_yielder_thread(void *arg)
|
|
|
180
194
|
return Qnil;
|
|
181
195
|
}
|
|
182
196
|
|
|
183
|
-
VALUE future_create(CassFuture *future, VALUE session, future_kind kind)
|
|
197
|
+
VALUE future_create(CassFuture *future, VALUE session, VALUE statement, future_kind kind)
|
|
184
198
|
{
|
|
185
199
|
CassandraFuture *cassandra_future;
|
|
186
200
|
VALUE cassandra_future_obj;
|
|
@@ -189,9 +203,11 @@ VALUE future_create(CassFuture *future, VALUE session, future_kind kind)
|
|
|
189
203
|
cassandra_future->kind = kind;
|
|
190
204
|
cassandra_future->future = future;
|
|
191
205
|
cassandra_future->session_obj = session;
|
|
206
|
+
cassandra_future->statement_obj = statement;
|
|
192
207
|
cassandra_future->proc_mutex = rb_mutex_new();
|
|
193
208
|
uv_sem_init(&cassandra_future->sem, 0);
|
|
194
209
|
cassandra_future->already_waited = false;
|
|
210
|
+
cassandra_future->yielded = false;
|
|
195
211
|
|
|
196
212
|
return cassandra_future_obj;
|
|
197
213
|
}
|
|
@@ -208,11 +224,13 @@ static VALUE future_on_success_synchronize(VALUE future)
|
|
|
208
224
|
wakeup_thread = true;
|
|
209
225
|
}
|
|
210
226
|
|
|
211
|
-
cassandra_future->on_success_block
|
|
227
|
+
RB_OBJ_WRITE(future, &cassandra_future->on_success_block, rb_block_proc());
|
|
212
228
|
|
|
213
229
|
if (cass_future_ready(cassandra_future->future)) {
|
|
214
230
|
uv_sem_post(&cassandra_future->sem);
|
|
215
|
-
if (
|
|
231
|
+
if (!cassandra_future->yielded &&
|
|
232
|
+
cass_future_error_code(cassandra_future->future) == CASS_OK) {
|
|
233
|
+
cassandra_future->yielded = true;
|
|
216
234
|
future_result_success_yield(cassandra_future);
|
|
217
235
|
}
|
|
218
236
|
return future;
|
|
@@ -263,11 +281,13 @@ static VALUE future_on_failure_synchronize(VALUE future)
|
|
|
263
281
|
wakeup_thread = true;
|
|
264
282
|
}
|
|
265
283
|
|
|
266
|
-
cassandra_future->on_failure_block
|
|
284
|
+
RB_OBJ_WRITE(future, &cassandra_future->on_failure_block, rb_block_proc());
|
|
267
285
|
|
|
268
286
|
if (cass_future_ready(cassandra_future->future)) {
|
|
269
287
|
uv_sem_post(&cassandra_future->sem);
|
|
270
|
-
if (
|
|
288
|
+
if (!cassandra_future->yielded &&
|
|
289
|
+
cass_future_error_code(cassandra_future->future) != CASS_OK) {
|
|
290
|
+
cassandra_future->yielded = true;
|
|
271
291
|
future_result_failure_yield(cassandra_future);
|
|
272
292
|
}
|
|
273
293
|
return future;
|
data/ext/ilios/ilios.c
CHANGED
data/ext/ilios/ilios.h
CHANGED
|
@@ -65,6 +65,7 @@ typedef struct
|
|
|
65
65
|
|
|
66
66
|
uv_sem_t sem;
|
|
67
67
|
bool already_waited;
|
|
68
|
+
bool yielded;
|
|
68
69
|
} CassandraFuture;
|
|
69
70
|
|
|
70
71
|
extern const rb_data_type_t cassandra_cluster_data_type;
|
|
@@ -100,7 +101,7 @@ extern void Init_statement(void);
|
|
|
100
101
|
extern void Init_result(void);
|
|
101
102
|
extern void Init_future(void);
|
|
102
103
|
|
|
103
|
-
extern VALUE future_create(CassFuture *future, VALUE session, future_kind kind);
|
|
104
|
+
extern VALUE future_create(CassFuture *future, VALUE session, VALUE statement, future_kind kind);
|
|
104
105
|
extern void nogvl_future_wait(CassFuture *future);
|
|
105
106
|
extern CassFuture *nogvl_session_prepare(CassSession* session, VALUE query);
|
|
106
107
|
extern CassFuture *nogvl_session_execute(CassSession* session, CassStatement* statement);
|
data/ext/ilios/nogvl.c
CHANGED
|
@@ -59,8 +59,17 @@ static void *nogvl_sem_wait_cb(void *ptr)
|
|
|
59
59
|
return NULL;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
static void nogvl_sem_wait_ubf(void *ptr)
|
|
63
|
+
{
|
|
64
|
+
uv_sem_t *sem = (uv_sem_t *)ptr;
|
|
65
|
+
// Wake the blocked uv_sem_wait so the call can be interrupted
|
|
66
|
+
// (e.g. Thread#kill) instead of relying on signal delivery, which
|
|
67
|
+
// uv_sem_wait restarts on EINTR.
|
|
68
|
+
uv_sem_post(sem);
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
void nogvl_sem_wait(uv_sem_t *sem)
|
|
63
72
|
{
|
|
64
73
|
// Releases GVL to run another thread while waiting
|
|
65
|
-
rb_thread_call_without_gvl(nogvl_sem_wait_cb, sem,
|
|
74
|
+
rb_thread_call_without_gvl(nogvl_sem_wait_cb, sem, nogvl_sem_wait_ubf, sem);
|
|
66
75
|
}
|
data/ext/ilios/session.c
CHANGED
|
@@ -32,7 +32,7 @@ static VALUE session_prepare_async(VALUE self, VALUE query)
|
|
|
32
32
|
GET_SESSION(self, cassandra_session);
|
|
33
33
|
|
|
34
34
|
prepare_future = nogvl_session_prepare(cassandra_session->session, query);
|
|
35
|
-
return future_create(prepare_future, self, prepare_async);
|
|
35
|
+
return future_create(prepare_future, self, Qnil, prepare_async);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -91,7 +91,7 @@ static VALUE session_execute_async(VALUE self, VALUE statement)
|
|
|
91
91
|
GET_STATEMENT(statement, cassandra_statement);
|
|
92
92
|
|
|
93
93
|
result_future = nogvl_session_execute(cassandra_session->session, cassandra_statement->statement);
|
|
94
|
-
return future_create(result_future, self, execute_async);
|
|
94
|
+
return future_create(result_future, self, statement, execute_async);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|
data/lib/ilios/version.rb
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Ilios
|
|
4
|
-
VERSION = '1.0.
|
|
4
|
+
VERSION = '1.0.3'
|
|
5
5
|
public_constant :VERSION
|
|
6
6
|
|
|
7
7
|
CASSANDRA_CPP_DRIVER_VERSION = '2.17.1'
|
|
8
8
|
public_constant :CASSANDRA_CPP_DRIVER_VERSION
|
|
9
9
|
|
|
10
|
-
LIBUV_VERSION = '1.
|
|
10
|
+
LIBUV_VERSION = '1.52.1'
|
|
11
11
|
public_constant :LIBUV_VERSION
|
|
12
12
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ilios
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Watson
|
|
@@ -58,7 +58,7 @@ metadata:
|
|
|
58
58
|
homepage_uri: https://github.com/Watson1978/ilios
|
|
59
59
|
source_code_uri: https://github.com/Watson1978/ilios
|
|
60
60
|
bug_tracker_uri: https://github.com/Watson1978/ilios/issues
|
|
61
|
-
documentation_uri: https://www.rubydoc.info/gems/ilios/1.0.
|
|
61
|
+
documentation_uri: https://www.rubydoc.info/gems/ilios/1.0.3
|
|
62
62
|
rubygems_mfa_required: 'true'
|
|
63
63
|
rdoc_options: []
|
|
64
64
|
require_paths:
|
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
75
75
|
version: '0'
|
|
76
76
|
requirements:
|
|
77
77
|
- cmake
|
|
78
|
-
rubygems_version:
|
|
78
|
+
rubygems_version: 4.0.10
|
|
79
79
|
specification_version: 4
|
|
80
80
|
summary: Cassandra driver written by C language
|
|
81
81
|
test_files: []
|