instance_id
stringlengths
10
65
repo
stringlengths
5
59
pr_number
int64
1
313k
task_type
stringclasses
1 value
base_commit
stringlengths
40
40
review_commit
stringlengths
40
40
title
stringlengths
2
282
body
stringlengths
7
3k
patch
stringlengths
202
204k
n_defects
int64
1
72
n_supported
int64
1
65
n_major
int64
0
32
defects
stringlengths
140
18.8k
certifier_count
int64
apache__casbin__1012
apache/casbin
1,012
defect
f977642024a51f839e0751df569004a5ce4ec7ef
fbc329c9024875cd566df3ecaf550bdac91cb78c
fix: handle duplicate adapter entries
fix: #1011 Signed-off-by: Andreas Bichinger <andreas.bichinger@gmail.com>
diff --git a/persist/adapter.go b/persist/adapter.go index 270110c51..5d9507c69 100644 --- a/persist/adapter.go +++ b/persist/adapter.go @@ -44,8 +44,10 @@ func LoadPolicyLine(line string, m model.Model) { func LoadPolicyArray(rule []string, m model.Model) { key := rule[0] sec := key[:1] - m[sec][key].Policy = app...
2
1
0
[{"id": "G0", "claim": "The rewritten persist/persist_test.go lacks the Apache license header and it should be added.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The reviewer asks why the test file's package name was changed from persist to per...
null
apache__casbin__1041
apache/casbin
1,041
defect
860d290f060d7ec69396dd13ff299b3f35f1882a
bb2af2a63b7c0312e0cedbaaf5a5df5c2014b272
feat: add FieldIndexMap and constant
# ChangLog Some APIs (mostly RBAC APIs) need to obtain the index of variables such as sub, obj, dom, priority, etc. in policy_define. So this PR did the following work 1. add ``FieldIndexMap`` to store index. 2. add ``GetFieldIndex`` and ``SetFieldIndex``, try to get the index with ``sub, obj, dom, priority`` as the...
diff --git a/constant/constants.go b/constant/constants.go new file mode 100644 index 000000000..19d3a407b --- /dev/null +++ b/constant/constants.go @@ -0,0 +1,16 @@ +package constant + +const ( + DomainIndex = "dom" + SubjectIndex = "sub" + ObjectIndex = "obj" + PriorityIndex = "priority" +) + +const ( + AllowOve...
2
2
0
[{"id": "G0", "claim": "The new constant/constants.go file is missing the Apache license header that casbin source files carry.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "In SortPoliciesByPriority (and the other new array element fetching) the...
null
apache__casbin__1093
apache/casbin
1,093
defect
74e094778fb3b2c3ed2e7a32d51dbaba59c8df39
3edb1b2a7896c76ec61070b3ffae75fec74b4302
feat: add management api for WatcherEx
fix https://github.com/casbin/casbin/issues/1092 part of: https://github.com/casbin/casbin/issues/999
diff --git a/enforcer_interface.go b/enforcer_interface.go index 7f20f1683..dba24649d 100644 --- a/enforcer_interface.go +++ b/enforcer_interface.go @@ -136,6 +136,15 @@ type IEnforcer interface { UpdateGroupingPolicy(oldRule []string, newRule []string) (bool, error) UpdateGroupingPolicies(oldRules [][]string, ne...
4
2
1
[{"id": "G0", "claim": "SelfAddPolicy should be implemented by extracting the code from addPolicy, with addPolicy calling SelfAddPolicy, instead of modifying the original parameters of addPolicy.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G2", "claim": "The shadowe...
null
apache__casbin__1201
apache/casbin
1,201
defect
ea5ed6b907fb98786e861f8ca453756aea938937
f663c19673df7d8ebea89b194701a516c5be9e69
feat: merge string-adapter into casbin main library
Hi @hsluoyz @qiangmzsx This PR is to merge [string-adapter](https://github.com/qiangmzsx/string-adapter) into casbin main library. All codes are copy from string-adapter and all unit test cases have passed. thank you. @qiangmzsx.
diff --git a/persist/string-adapter/adapter.go b/persist/string-adapter/adapter.go new file mode 100644 index 000000000..a217e4a7a --- /dev/null +++ b/persist/string-adapter/adapter.go @@ -0,0 +1,84 @@ +// Copyright 2017 The string-adapter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version...
7
7
0
[{"id": "G0", "claim": "Both new files should carry the Casbin Apache copyright header instead of the copied 'The string-adapter Authors' header.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The package name should be 'stringadapter' (no undersc...
null
apache__casbin__1230
apache/casbin
1,230
defect
2557f8dd4b377596b315e8ad8c17059f718da2b7
e0dc85887208dfc712375cbd32dc0b1ef10d8b8b
feat: add GetAllowedObjectConditions() API
a part of https://github.com/casbin/gorm-adapter/issues/195
diff --git a/errors/rbac_errors.go b/errors/rbac_errors.go index 53c315154..88c5ff2f3 100644 --- a/errors/rbac_errors.go +++ b/errors/rbac_errors.go @@ -23,4 +23,8 @@ var ( ERR_LINK_NOT_FOUND = errors.New("error: link between name1 and name2 does not exist") ERR_USE_DOMAIN_PARAMETER = errors.New("er...
3
3
2
[{"id": "G0", "claim": "Sort the imports in rbac_api_test.go.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The hard-coded 'r.obj.' prefix taken with policy[1][0:6] is not extendable; the prefix should be configurable.", "category": "design", "...
null
apache__casbin__1389
apache/casbin
1,389
defect
44b890de6147962bd055647faef2d4037ca15ac5
3d096008ce9e0e9e20a77771baf11281737a573c
feat: add error to some of the APIs
Fix #1369 This issue was paritially fixed by #1371, and this PR contains a fully fix. - Add nil check on `model` before anywhere `model["g"]["g"]` may be accessed. - **Public API changed**
diff --git a/enforcer_interface.go b/enforcer_interface.go index 11cc9e4fd..e424b1c8d 100644 --- a/enforcer_interface.go +++ b/enforcer_interface.go @@ -86,12 +86,12 @@ type IEnforcer interface { GetPermissionsForUserInDomain(user string, domain string) [][]string AddRoleForUserInDomain(user string, role string, do...
4
4
1
[{"id": "G0", "claim": "Returning empty values with no error when the required section or policy assertion is missing hides the problem instead of reporting it.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The duplicated missing-assertion check-and-err...
null
apache__casbin__1496
apache/casbin
1,496
defect
f2818d03173236338bd9cc64b9cb0df1a9470284
41fa1ba139261eda7a634d6a9c2126eab5977bc1
feat: completely remove domain from RoleManager when calling DeleteDomains
close #1492 The original `DeleteDomains()` only performed the task of `DeleteAllUsersByDomain()`, but now `DeleteDomains() ` will delete all associated policies as well.
diff --git a/model_test.go b/model_test.go index 9bb1e9e62..90752174c 100644 --- a/model_test.go +++ b/model_test.go @@ -411,6 +411,10 @@ func (rm *testCustomRoleManager) AddDomainLinkConditionFunc(user string, role st func (rm *testCustomRoleManager) SetDomainLinkConditionFuncParams(user string, role string, domain s...
9
7
2
[{"id": "G0", "claim": "The recursive call to e.DeleteDomains(domain) ignores any error returned; propagate and handle the error (and check the boolean) inside the loop to avoid silent failures.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The tes...
null
apache__casbin__397
apache/casbin
397
defect
7a8096d49b95982fb6c9dd8fb254004047d63250
25b8673c0b145447ccd9f6639b08c5d43f3529e3
Add a globMatch() built-in matching function
fix #396
diff --git a/examples/glob_model.conf b/examples/glob_model.conf new file mode 100644 index 000000000..b16cad499 --- /dev/null +++ b/examples/glob_model.conf @@ -0,0 +1,11 @@ +[request_definition] +r = sub, obj, act + +[policy_definition] +p = sub, obj, act + +[policy_effect] +e = some(where (p.eft == allow)) + +[match...
2
2
2
[{"id": "G0", "claim": "GlobMatch should avoid panicking on a path.Match error and instead return (bool, error), as nodece suggested.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The blanket (bool, error) signature change to the built-in matching funct...
null
apache__casbin__490
apache/casbin
490
defect
b8d7ab23ce01affc757c077f38797768580e829a
67349857a9b3c40db7c7d6baac88f03099c1cd4a
fix: Perform adapter persist actions before model changes
Should resolve #415. > If the model changes are made first but the adapter fails (network, code error, anything really), the in-memory model and adapter store will be out of sync. The next time the adapter is instantiated it will call LoadPolicy(x) in the store and the changes made in-memory will obviously be lost. ...
diff --git a/error_test.go b/error_test.go index 26e41cccc..5f944bcb3 100644 --- a/error_test.go +++ b/error_test.go @@ -125,7 +125,10 @@ func TestMockAdapterErrors(t *testing.T) { e, _ := NewEnforcer("examples/rbac_with_domains_model.conf", adapter) - _, err := e.AddPolicy("admin", "domain3", "data1", "read") + ...
3
2
1
[{"id": "G0", "claim": "The adapter persist action in the policy mutation methods runs without first calling model.HasPolicy, so a policy the model would reject can still be written to the adapter (e.g. a duplicate add, which the adapter may reject via a unique index).", "category": "correctness", "verdict": "supported...
null
apache__casbin__833
apache/casbin
833
defect
ecc6d90bd00c77235384013a5fdfe2e7aed82e66
0615729ad194fb0d0375219aa995ebe91e9f7e43
feat: add prioritizing based on role and user hierarchy
Signed-off-by: tangyang9464 <tangyang9464@163.com> Fix: #831 @hsluoyz @closetool plz review @merajsahebdar plz just change ``priority(p.eft) || deny`` -> ``subjectPriority(p.eft) || deny`` and test your case.
diff --git a/effector/default_effector.go b/effector/default_effector.go index 20f574b9c..465293d4c 100644 --- a/effector/default_effector.go +++ b/effector/default_effector.go @@ -32,7 +32,7 @@ func (e *DefaultEffector) MergeEffects(expr string, effects []Effect, matches [] explainIndex := -1 // short-circuit so...
10
8
2
[{"id": "G0", "claim": "The example policy file should put a blank space after each comma (e.g. \"g, editor, admin\").", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "SortPoliciesBySubjectHierarchy could assume the subject token is always first a...
null
apache__casbin__906
apache/casbin
906
defect
1121bda4aa45682e18f7f0939af765aa476cedc0
f4a183167942015a2f6e5e9a9812bbf2996e5d83
feat: add api AddPermissionsForUser
Signed-off-by: tangyang9464 <tangyang9464@163.com> close: #904
diff --git a/go.mod b/go.mod index 62fe53671..5df294942 100644 --- a/go.mod +++ b/go.mod @@ -5,4 +5,4 @@ require ( github.com/golang/mock v1.4.4 ) -go 1.13 +go 1.13 \ No newline at end of file diff --git a/go.sum b/go.sum index 85634876b..c88d82f04 100644 --- a/go.sum +++ b/go.sum @@ -7,4 +7,4 @@ golang.org/x/net ...
1
1
1
[{"id": "G0", "claim": "The new AddPermissionsForUser method should also be added to the Enforcer (IEnforcer) interface in enforcer_interface.go.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
apache__casbin__910
apache/casbin
910
defect
de8de4eea82832cc1feca139fab2a8011a3d2455
ab9448d71400bf462855518c48cd21a015e2628a
feat: keyMatch5 for ignoring params in url
Fix: https://github.com/casbin/casbin/issues/909 ## What problem does this PR solve? Add KeyMatch5 to ignoring params in URL when matching keys. Related Issue: #909 ## What is changed and how it works? Add a new operation `keyMatch5` ## Check List ### Tests Unit test ### Code changes Has exported...
diff --git a/model/function.go b/model/function.go index 2ac426f9b..4a50415a8 100644 --- a/model/function.go +++ b/model/function.go @@ -44,6 +44,7 @@ func LoadFunctionMap() FunctionMap { fm.AddFunction("keyGet2", util.KeyGet2Func) fm.AddFunction("keyMatch3", util.KeyMatch3Func) fm.AddFunction("keyMatch4", util.K...
2
2
1
[{"id": "G0", "claim": "The KeyMatch5Func wrapper calls KeyMatch4 instead of KeyMatch5 (a typo), so the new keyMatch5 function does not ignore URL parameters as intended.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "CI only runs the unit tests in ...
null
apache__casbin__974
apache/casbin
974
defect
833f1af33cb49776d966fa877b16a7c75eeea427
ad68d25d16ff471a0f6d3374b871c5112d05b968
feat: Add RBAC API for GetAllDomains
Fixes #971 Adds an API to get all the domains. Kindly review @hsluoyz and please tell if you have any suggestions.
diff --git a/rbac/default-role-manager/role_manager.go b/rbac/default-role-manager/role_manager.go index 27c0b10d9..94eb7527d 100644 --- a/rbac/default-role-manager/role_manager.go +++ b/rbac/default-role-manager/role_manager.go @@ -357,6 +357,16 @@ func (rm *RoleManager) GetDomains(name string) ([]string, error) { r...
4
3
2
[{"id": "G0", "claim": "GetAllDomains should use the role managers of the `g` and `gX` sections (like `g`, `g2`, `g3`) rather than the `p` section it currently reads.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The test helper testGetAllDomains i...
null
apache__casbin__988
apache/casbin
988
defect
54eba5e1669e7621a62f37f76ff904f6d6c4244e
59f633e7b86347ec87cdd8cdeec31e7155c87482
fix: lock less when syncing
Lock the `SyncedEnforcer` only when replacing the model and not during the entire policy reload duration. Fixes https://github.com/casbin/casbin/issues/987
diff --git a/enforcer.go b/enforcer.go index 91e4c420e..42328d3d3 100644 --- a/enforcer.go +++ b/enforcer.go @@ -281,10 +281,38 @@ func (e *Enforcer) ClearPolicy() { // LoadPolicy reloads the policy from file/database. func (e *Enforcer) LoadPolicy() error { - needToRebuild := false + newModel, err := e.prepareNewM...
3
3
1
[{"id": "G0", "claim": "Something in the pull request shown in the attached screenshot needs fixing (the screenshot's content is not readable in the transcript).", "category": "unknown", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "StartAutoLoadPolicy should keep calling Load...
null
apache__cassandra-cpp-driver__103
apache/cassandra-cpp-driver
103
defect
b9fdb1ac36f2561b540b7dd1c23169cf8baa431a
c17fa5090209e8815bb87b518af85687f042dda2
CPP-162 - Fix for spurious request hang
Refactored/Simplified SPSC and renamed some variables in MPMC to be more consistent. Added some tests for both.
diff --git a/src/async_queue.hpp b/src/async_queue.hpp index 3e5997791..e71465a70 100644 --- a/src/async_queue.hpp +++ b/src/async_queue.hpp @@ -19,6 +19,8 @@ #include "common.hpp" +#include <boost/atomic.hpp> + #include <uv.h> namespace cass { @@ -46,6 +48,21 @@ class AsyncQueue { bool enqueue(const type...
2
2
2
[{"id": "G0", "claim": "The new enqueue fence appears to have an undesired effect on the MPMC queue: the mpmc_async test would be expected to fail with two threads throwing 1,000,000 items at a queue of 10,000, and it does fail when the fence is removed, so the reviewer questions what the fence is doing.", "category": ...
null
apache__cassandra-cpp-driver__112
apache/cassandra-cpp-driver
112
defect
b9fdb1ac36f2561b540b7dd1c23169cf8baa431a
a58604a1d688e63f385026c0ee32ad860d5e20b9
CPP-180 - DC aware policy feature parity with other drivers
- Refactored DC aware policy - Added extra unit tests for DC aware
diff --git a/include/cassandra.h b/include/cassandra.h index 22e946fbb..15106337b 100644 --- a/include/cassandra.h +++ b/include/cassandra.h @@ -673,8 +673,6 @@ cass_cluster_set_credentials(CassCluster* cluster, /** * Configures the cluster to use round-robin load balancing. - * This is the default, and does not n...
1
1
0
[{"id": "G0", "claim": "DCAwarePolicy stores the inverse of the 'allow_remote_dcs_for_local_cl' setting internally; the reviewer asks whether the code could match the intent of the setting instead of inverting it inside the class.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
apache__cassandra-cpp-driver__249
apache/cassandra-cpp-driver
249
defect
93edc99af6b6bb393304f48a3bb0d08c5c5caf55
bf8dc595f035700392e97af4a251419f926fe69f
329 - Atomic [MSVC Intrinsics] fails to compile; 32-bit only
Also addressed threshold issues for 32-bit slowness of metrics
diff --git a/src/atomic/atomic_intrinsics_msvc.hpp b/src/atomic/atomic_intrinsics_msvc.hpp index 40142f9eb..b7e6b6e98 100644 --- a/src/atomic/atomic_intrinsics_msvc.hpp +++ b/src/atomic/atomic_intrinsics_msvc.hpp @@ -36,8 +36,8 @@ #endif // Windows Server 2003 or higher required to build because -// Interlocked*64(...
2
2
2
[{"id": "G0", "claim": "The 32-bit _InterlockedExchangeAdd64 loop must pass old_value (read once before the loop) as both the exchange value and the comparand of _InterlockedCompareExchange64, because reading *storage again inside the CAS may return values changed by another thread.", "category": "correctness", "verdic...
null
apache__cassandra-cpp-driver__259
apache/cassandra-cpp-driver
259
defect
95e4fab5ea41dcdd29193b5378c488a2b60525c9
4b24252e805cc8eea81c9d33f34d9479ff7b8592
344: Make libssh2 optional when building tests
Since CCM commands can now be run locally libssh2 can be considered optional. This change will present a status message if -DCASS_USE_LIBSSH2=ON and cannot be found; indicating libssh2/remote commands will be disabled. This change also allows for the building of either the integration (libssh2 optional), unit tests, or...
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3853dfa14..420f07e5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,11 @@ if(POLICY CMP0042) cmake_policy(SET CMP0042 OLD) endif() +# Force OLD style of implicitly dereferencing variables +if(POLICY CMP0054) + cmake_policy(SET CMP0054 OLD) +endif(...
1
1
0
[{"id": "G0", "claim": "The newly added CMake option descriptions should say \"Build integration tests\" and \"Build unit tests\" instead of the copy-pasted \"Build tests\".", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
apache__cassandra-cpp-driver__347
apache/cassandra-cpp-driver
347
defect
89f35d963b77e81b42032ff30f7cb7b07b0f6c1f
6a1383b97924d3af13bacbef3ae52106046ea06f
CPP-434
Update api, tests, docs, examples to use 32-bit int's for Duration attributes.
diff --git a/examples/duration/duration.c b/examples/duration/duration.c index b9c35ccad..7c582d6db 100644 --- a/examples/duration/duration.c +++ b/examples/duration/duration.c @@ -74,7 +74,7 @@ CassError execute_query(CassSession* session, const char* query) { return rc; } -CassError insert_into(CassSession* ses...
2
2
1
[{"id": "G0", "claim": "cass::CassDuration in src/types.hpp still uses cass_int64_t for months/days/nanos, inconsistent with the 32-bit Duration API the pull request introduces.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Use static_cast<> instea...
null
apache__cassandra-cpp-driver__411
apache/cassandra-cpp-driver
411
defect
1b9f98ee3cf7a9ffab38e3e21acaa47c4ce39b9f
a8ac0b496637adb524b9b997bb45443b3b6bd20e
CPP-499 allow local bind
Fix https://datastax-oss.atlassian.net/browse/CPP-499, i.e., add `cass_cluster_set_local_address` to allow clients to bind a local IP address before connecting to Cassandra. This is important for hosts using multiple network interfaces with strict network separation requirements.
diff --git a/gtests/src/integration/objects/cluster.hpp b/gtests/src/integration/objects/cluster.hpp index 029cd4c6a..3f77b275e 100644 --- a/gtests/src/integration/objects/cluster.hpp +++ b/gtests/src/integration/objects/cluster.hpp @@ -134,6 +134,19 @@ class Cluster : public Object<CassCluster, cass_cluster_free> { ...
4
4
1
[{"id": "G0", "claim": "The continuation lines of the new cass_cluster_set_local_address() declarations in include/cassandra.h are misaligned — a spacing nit.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The _n variant's declaration should be ...
null
apache__cassandra-cpp-driver__427
apache/cassandra-cpp-driver
427
defect
cbd6de67a25076920e7214a13eea89d2a92a6ee7
a563548c145aa7c82fef3eedfa0a816e7ed6d83d
CPP-687 - Fix recovery of remote DC host
The DC-aware load balancing policy depends on an internal host map to determine host distance. The problem was the host distance was being checked to determine whether a node should be added or marked as up. This fix always adds and marks hosts up even if they're ignored. The distance is only used to determine if a ho...
diff --git a/gtests/src/unit/mockssandra.cpp b/gtests/src/unit/mockssandra.cpp index a9b322df1..47738740c 100644 --- a/gtests/src/unit/mockssandra.cpp +++ b/gtests/src/unit/mockssandra.cpp @@ -1807,15 +1807,22 @@ cass::String SchemaChangeEvent::encode(SchemaChangeEvent::Target target, SchemaC void Cluster::init(Addr...
4
4
0
[{"id": "G0", "claim": "The two parameters of Cluster::init should be split onto separate lines.", "category": "style", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The declaration of Cluster::init in the header should be split onto separate lines like the requested formattin...
null
apache__cassandra-cpp-driver__561
apache/cassandra-cpp-driver
561
defect
f4e8c4e49e69f02a3f9bd2a9862518ef9ce8a3c8
9670aaa799e9f76de7e84512f928fd13236465d1
CPP-964 Add refresh-interval support for histogram metrics
Port of Java functionality as defined [here](https://github.com/datastax/java-driver/blob/4.x/core/src/main/resources/reference.conf#L1554-L1571).
diff --git a/include/cassandra.h b/include/cassandra.h index bbe9c6c1c..570acb1be 100644 --- a/include/cassandra.h +++ b/include/cassandra.h @@ -2934,6 +2934,28 @@ CASS_EXPORT void cass_cluster_set_monitor_reporting_interval(CassCluster* cluster, unsigned interval_secs); ...
1
1
1
[{"id": "G0", "claim": "With the refresh interval enabled, a window in which no requests were recorded reports snapshot.min as INT64_MAX (from hdr_reset on the aggregate histogram) instead of zero, unlike the non-windowed path, which the reviewer says should be addressed before merging.", "category": "correctness", "ve...
null
apache__cassandra-cpp-driver__81
apache/cassandra-cpp-driver
81
defect
b4eaa8ae27860763eff7d833ee05ae31f81679a7
55450bc19bd398f7d0a863d17655a7d992b1a1c3
Session Guard Integration Test for CPP-161
- Added a testing directive preprocessor definition - This is currently used for the session to throw an exception instead of abort during the session guard and for the ref counter in the event of a double free - CMake option CASS_USE_TESTING_DIRECTIVE is required and is only available if CASS_BUILD_TESTS is enable...
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5496be671..e12168109 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ option(CASS_BUILD_STATIC "Build static library" OFF) option(CASS_BUILD_EXAMPLES "Build examples" ON) option(CASS_BUILD_TESTS "Build tests" OFF) option(CASS_USE_TCMALLOC "Use tcma...
3
2
1
[{"id": "G0", "claim": "The new session guard test should be conditionally included under a flag — or the flag always defined when CASS_BUILD_TESTS=ON — so the test suite stays viable even without the special flag.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "c...
null
apache__cassandra-gocql-driver__1023
apache/cassandra-gocql-driver
1,023
defect
1762cce65eafd098045e30ef2b7df2c289740971
d0b415b5175e12260f900ef95ee105ef4cdb6385
adding observer to query
Introducing `QueryObserver` and adding it to `Query` which gets called every time the query is executed (via `ExecutableQuery.attempt`, modified slightly). Introduced to allow monitoring of gocql, should be generic enough to support all monitoring libraries.
diff --git a/AUTHORS b/AUTHORS index 9628c6803..e89312540 100644 --- a/AUTHORS +++ b/AUTHORS @@ -98,3 +98,4 @@ Michał Matczuk <mmatczuk@gmail.com> Ben Krebsbach <ben.krebsbach@gmail.com> Vivian Mathews <vivian.mathews.3@gmail.com> Sascha Steinbiss <satta@debian.org> +Javier Zunzunegui <javier.zunzunegui.b@gmail.com>...
7
7
1
[{"id": "G0", "claim": "The observer method should be named ObserveQuery and its signature should take a context as the first parameter.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Remove SetQueryObserver from the session because session-level globals...
null
apache__cassandra-gocql-driver__1081
apache/cassandra-gocql-driver
1,081
defect
2e9f2912ba58e37f34af3554659b576eac655760
2c4467e2e7a0b8be91fe9ec095f3de54397b558b
add conviction policy interface
#1079 Conviction policy: decide when to mark the host as 'down' based on the error. Default: `SimpleConvictionPolicy` - mark host as 'down' on any error. Opened interface in policies.go for user to implement their own policies.
diff --git a/cluster.go b/cluster.go index b03427064..08e8be720 100644 --- a/cluster.go +++ b/cluster.go @@ -54,6 +54,7 @@ type ClusterConfig struct { Compressor Compressor // compression algorithm (default: nil) Authenticator Authenticator // authenticator (default: nil) RetryPolicy R...
5
5
2
[{"id": "G0", "claim": "The ConvictionPolicy.AddFailure method should take the host info of the host that caused the error.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The ConvictionPolicy.Reset method should also take the host it clears state for, as...
null
apache__cassandra-gocql-driver__1082
apache/cassandra-gocql-driver
1,082
defect
12e3a8c05db483441932e84ab6c35c339fb01de7
48f3f4891d438a30b2a41c96239d30f905645a12
DowngradingConsistencyPolicy and enhancements to retry policy behaviour
PR for #1070 Tested against 3-node cluster with the new query execution and returned error types. DowngradingConsistencyPolicy takes a slice of consistency levels and try them in order if the query fails. The rest of the retry logics are similar to the Python driver with minor tweaks: http://datastax.github.i...
diff --git a/conn.go b/conn.go index 506ae3413..74d176f63 100644 --- a/conn.go +++ b/conn.go @@ -964,6 +964,15 @@ func (c *Conn) executeQuery(qry *Query) *Iter { } return &Iter{err: x, framer: framer} + + // for DowngradeConsistencyPolicy + case *RequestErrUnavailable: + return &Iter{err: resp.(*RequestErrUnav...
7
6
1
[{"id": "G0", "claim": "The code should be run through gofmt, as it is not formatted to the standard Go layout.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "This change requires tests that verify each of the retry cases works, which the pull r...
null
apache__cassandra-gocql-driver__1151
apache/cassandra-gocql-driver
1,151
defect
e06f8c1bcd787e6bf0608288b314522f08cc7848
a26542686929a71567f2fc2df1a23dcdc40938a9
Provide a way to limit per-query-attempt deadlines
This adds the ability to constrain the runtime of individual query attempts. Right now we have the situation that there are no retries if the coordinator times out responding as there's only the possibility to time out a query via the context. This is also somewhat related to https://github.com/gocql/gocql/issues/812#i...
diff --git a/AUTHORS b/AUTHORS index 14cae308b..207bdc676 100644 --- a/AUTHORS +++ b/AUTHORS @@ -106,3 +106,5 @@ Chang Liu <changliu.it@gmail.com> Ingo Oeser <nightlyone@gmail.com> Luke Hines <lukehines@protonmail.com> Jacob Greenleaf <jacob@jacobgreenleaf.com> +Andreas Jaekle <andreas@jaekle.net> +Daniel Lohse <dan...
7
6
3
[{"id": "G0", "claim": "The hard-coded `requests > 8` retry bound in TestQueryRetry is a magic number disconnected from the test policy's NumRetries of 10 and unexplained; parameterise it and use it in both assertions, or put a comment above it (or remove the check).", "category": "testing", "verdict": "supported", "pr...
null
apache__cassandra-gocql-driver__1160
apache/cassandra-gocql-driver
1,160
defect
153a7286a8d8aae91e5d045d84128d8de0b4eb4c
8acdce8d6c5d7e16fda00b236eaae8e8ec353404
Shorten runtime for long tests
`skipLong` option allows skipping DNS and StartupTimeout tests, making unittests run in under 5s. Considering that we run unittests a lot to make sure stuff is not overly broken, this saves a lot of time during dev. Signed-off-by: Alex Lourie <alex@instaclustr.com>
diff --git a/common_test.go b/common_test.go index bcd88bbb5..1d73edb86 100644 --- a/common_test.go +++ b/common_test.go @@ -23,6 +23,7 @@ var ( flagRunAuthTest = flag.Bool("runauth", false, "Set to true to run authentication test") flagCompressTest = flag.String("compressor", "", "compressor to use") flagTimeou...
2
2
0
[{"id": "G0", "claim": "Use Go's built-in testing.Short() support (go test -short) instead of the custom skipLong flag to skip long tests.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Reduce some of the timeouts for TestDNSLookupConnected (rather than ...
null
apache__cassandra-gocql-driver__1194
apache/cassandra-gocql-driver
1,194
defect
5a139e8dcc59d560335dbda641b9f42085e59b0a
d845a0e2eba7b867634c207bb8f7b84343540fd6
conn: avoid spinning in write coalesce with no work
Spinning in the write coalescer when there is no work causes high CPU load for no reason. Use a second cond to start the flush loop once per coalesce.
diff --git a/conn.go b/conn.go index bb7381891..fb0bd1a20 100644 --- a/conn.go +++ b/conn.go @@ -266,8 +266,9 @@ func (s *Session) dial(host *HostInfo, cfg *ConnConfig, errorHandler ConnErrorHa // dont coalesce startup frames if s.cfg.WriteCoalesceWaitTime > 0 { w := &writeCoalescer{ - cond: sync.NewCond(&sync...
2
1
1
[{"id": "G0", "claim": "In Write, it would be pretty safe to just mark running and broadcast without checking the current status, i.e. the new `if !w.running` guard could be dropped.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The writeFlusher can wai...
null
apache__cassandra-gocql-driver__1202
apache/cassandra-gocql-driver
1,202
defect
843d9a6e022dbaafac6ddedfcb88c3a9e48b960b
e54f0c5f1394114b41c49acdbd934a0b0fd5a64d
Fix cassandraVersion.Before() call
cc @Zariel @beltran Signed-off-by: Alex Lourie <alex@instaclustr.com>
diff --git a/cassandra_test.go b/cassandra_test.go index fa07bd110..c66acc2ea 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -2834,7 +2834,7 @@ func TestUnmarshallNestedTypes(t *testing.T) { } func TestSchemaReset(t *testing.T) { - if flagCassVersion.Major == 0 || (flagCassVersion.Before(2, 1, 3)) { + if...
1
1
1
[{"id": "G0", "claim": "The rewritten Before() returns true for c=(4,1,0) against arguments (3,1,2) when it should return false, because the patch branch compares c.Minor with minor instead of c.Major with major.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
apache__cassandra-gocql-driver__1215
apache/cassandra-gocql-driver
1,215
defect
26b68fd731048f2db526e5e6147a69330cb241bc
d1c522526fd216bc845401c0dad8c118ffed92bd
conn: check we can use compression in startup
If the user asks to use compression check that the remote server supports it by making an options call first. Rejig conn startup to be self contained. fixes #1205
diff --git a/conn.go b/conn.go index ce7f502bb..eca672541 100644 --- a/conn.go +++ b/conn.go @@ -227,40 +227,14 @@ func (s *Session) dial(host *HostInfo, cfg *ConnConfig, errorHandler ConnErrorHa } defer cancel() - frameTicker := make(chan struct{}, 1) - startupErr := make(chan error) - go func() { - for range f...
1
1
1
[{"id": "G0", "claim": "When the for loop over the server-supported compression algorithms ends without setting m[\"COMPRESSION\"], s.conn.compressor should be reset to nil and something appropriate logged, since the backend does not support the configured compressor.", "category": "correctness", "verdict": "supported"...
null
apache__cassandra-gocql-driver__1245
apache/cassandra-gocql-driver
1,245
defect
33c0e89ca93ad9f5069645af476dfb1f97195621
984092c19f352980508841d698a72d510f464b40
repair write coalescing
Current write coalescing depends on the idea that the passed in connection can do the writev syscall. In Go only net.Conns implemented by the net package have this property, since that the mechanism requires an implementation of a private method, checked against an interface private to the net package. So in p...
diff --git a/conn.go b/conn.go index cc1540e48..efa59f778 100644 --- a/conn.go +++ b/conn.go @@ -243,7 +243,7 @@ func (s *Session) dial(host *HostInfo, cfg *ConnConfig, errorHandler ConnErrorHa // dont coalesce startup frames if s.cfg.WriteCoalesceWaitTime > 0 && !cfg.disableCoalesce { - c.w = newWriteCoalescer(...
1
1
1
[{"id": "G0", "claim": "There is a race condition in the new TestWriteCoalescing test.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
apache__cassandra-gocql-driver__1286
apache/cassandra-gocql-driver
1,286
defect
fc3925ac2cbd49839569d6a454bf5b66c89f347e
7ecadd3e74cd493055a65edc4c3da09b58dff350
marshalling: treat cql time type as time.Duration
After discussions it was proposed to treat time as Go time.Duration. This makes it consistent with what time is in the spec despite it's name. The discussion took place in https://github.com/gocql/gocql/pull/1283 which was about a panic from incorrectly handling of the cql type time. The cassandra spec (https://...
diff --git a/helpers.go b/helpers.go index fb158847d..0eb30d07e 100644 --- a/helpers.go +++ b/helpers.go @@ -26,6 +26,8 @@ func goType(t TypeInfo) reflect.Type { return reflect.TypeOf(*new(string)) case TypeBigInt, TypeCounter: return reflect.TypeOf(*new(int64)) + case TypeTime: + return reflect.TypeOf(*new(ti...
2
1
1
[{"id": "G0", "claim": "The new tests for the `time` type use protocol versions that predate the type: `time` (and `date`) were added in CQL protocol v4, so `proto` needs to be 4 — not 5 in TestMarshalTime and not 2 in the marshalTests entries.", "category": "correctness", "verdict": "supported", "priority": "P1", "sco...
null
apache__cassandra-gocql-driver__1450
apache/cassandra-gocql-driver
1,450
defect
cd04bd7f22a72810d9eccd3ea334d898bf098576
46014167db2f56d72c48c5a6c1770736d5b8f584
fix tuple unmarshaling
There are two problems. First, tuples with a null value are not handled properly which results in a panic: panic: runtime error: slice bounds out of range [:-1] goroutine 1 [running]: github.com/gocql/gocql.unmarshalTuple(0x769880, 0xc0000e8cc0, 0xc0000ae83a, 0x10, 0x4a, 0xc000186540, 0xc00019048...
diff --git a/marshal.go b/marshal.go index fda5be662..dd1d5e605 100644 --- a/marshal.go +++ b/marshal.go @@ -1951,16 +1951,22 @@ func unmarshalTuple(info TypeInfo, data []byte, value interface{}) error { } for i, elem := range tuple.Elems { - m := readInt(data) - data = data[4:] + var p []byte + if len(...
2
1
1
[{"id": "G0", "claim": "The example code for reproducing the issue should be converted into tests in marshal_test.go so regressions in tuple unmarshaling are automatically checked in the future.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The tuple-e...
null
apache__cassandra-gocql-driver__1498
apache/cassandra-gocql-driver
1,498
defect
393f0c961220893ab75e4627f1487608014502a7
599c8f61bb5e96300757bcf363ea8b3fd92c7636
Bound values added in fields of ObservedQuery and ObservedBatch struct
The statements passed in the statement fields of ObservedQuery and ObservedBatch, do not account for the bound values passed while executing a query. Refer issue: #1497 for more details
diff --git a/AUTHORS b/AUTHORS index e908b94ad..2c5c52b73 100644 --- a/AUTHORS +++ b/AUTHORS @@ -115,3 +115,4 @@ Pavel Buchinchik <p.buchinchik@gmail.com> Rintaro Okamura <rintaro.okamura@gmail.com> Yura Sokolov <y.sokolov@joom.com>; <funny.falcon@gmail.com> Jorge Bay <jorgebg@apache.org> +Tushar Das <tushar.das5@gm...
2
2
1
[{"id": "G0", "claim": "Add documentation comments for the newly added Values fields on ObservedQuery and ObservedBatch, as in the examples given.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The test code added in TestBatchObserve does not comp...
null
apache__cassandra-gocql-driver__1505
apache/cassandra-gocql-driver
1,505
defect
5913df4d474e0b2492a129d17bbb3c04537a15cd
bcf5504ed311cca75d246864eafab525d5a558e8
Do not allocate extra bytes in unmarshalUUID
If unmarshalUUID called with value of type gocql.UUID, we already have allocated bytes for UUID, so do not allocate extra UUID, but just copy data to value. Also add ability to unmarshal directly to array of 16 bytes.
diff --git a/marshal.go b/marshal.go index e95c1c8f9..5a7be0c44 100644 --- a/marshal.go +++ b/marshal.go @@ -1711,7 +1711,7 @@ func marshalUUID(info TypeInfo, value interface{}) ([]byte, error) { } func unmarshalUUID(info TypeInfo, data []byte, value interface{}) error { - if data == nil || len(data) == 0 { + if le...
1
1
0
[{"id": "G0", "claim": "The new UUID length-check error message should start with a lowercase letter, changing `Unable` to `unable`, per Go error-string conventions.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
apache__cassandra-gocql-driver__1525
apache/cassandra-gocql-driver
1,525
defect
43a8f9bf6605c25fcaa921fb7c9f8b3d6024f05d
45a76c0e5b733760d7af7d2fede0d2d72a70b795
fix compileMetadata bug for materialized views
Fixes https://github.com/gocql/gocql/issues/1524 for materialised views
diff --git a/cassandra_test.go b/cassandra_test.go index d06274bcd..4f7b7549a 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -2248,10 +2248,10 @@ func TestMaterializedViewMetadata(t *testing.T) { if materializedViews == nil { t.Fatal("failed to query view metadata, nil returned") } - if len(materializ...
3
2
0
[{"id": "G0", "claim": "The added fatal message should say \"expected two views\" instead of \"expected two view\".", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The added fatal message should read \"failed to find materialized view view_view i...
null
apache__cassandra-gocql-driver__1529
apache/cassandra-gocql-driver
1,529
defect
9e3bb6cbd8817fc0752ee6f4461a412f79496344
22fc1479afc7f8d8dda4df047a36cd4d00b1d028
Tuple unmarshaling improvements
This PR improves some aspects of tuple unmarshaling: - In case of nested tuples which use pointers to represent their elements, now element is set to nil if the element was NULL in the query result - previously it was set to zero value. - When unmarshaling the last element of a tuple, and the element was set to an ...
diff --git a/marshal.go b/marshal.go index f3b2ac7df..1f3c4aa16 100644 --- a/marshal.go +++ b/marshal.go @@ -2075,7 +2075,11 @@ func unmarshalTuple(info TypeInfo, data []byte, value interface{}) error { switch rv.Field(i).Kind() { case reflect.Ptr: - rv.Field(i).Set(reflect.ValueOf(v)) + if p != nil { +...
3
2
0
[{"id": "G0", "claim": "The redundant `Elem().Addr()` can be removed, using `reflect.New(rv.Type()).Interface()` instead of `reflect.New(rv.Type()).Elem().Addr().Interface()`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The PR author should a...
null
apache__cassandra-gocql-driver__1609
apache/cassandra-gocql-driver
1,609
defect
0eacd31836251d409774cd626b5c7e8d61b323db
1adb885ced93cfe13b58c96acbe6c07a3b506277
Check HostFilter for control connection
Check the HostFilter when making the control connection. This allows you to filter out connecting to the wrong DC or an undesirable host for the control connection. This also has the benefit of allowing the HostFilter to modify the ConnectAddress which fixes #1608. If you filter out the chosen host for the control c...
diff --git a/control.go b/control.go index 050136637..f5fe748af 100644 --- a/control.go +++ b/control.go @@ -167,25 +167,14 @@ func shuffleHosts(hosts []*HostInfo) []*HostInfo { return shuffled } -func (c *controlConn) shuffleDial(endpoints []*HostInfo) (*Conn, error) { - // shuffle endpoints so not all drivers wi...
3
2
0
[{"id": "G0", "claim": "The host should be filtered out before the connection is dialed, rather than only after the control connection is established.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The TODO comment above the localHostInfo call should be up...
null
apache__cassandra-gocql-driver__1659
apache/cassandra-gocql-driver
1,659
defect
0da64451f8dedea8e6c90030b9c4be3566317138
a31c780fb63c97876c06e6a6b6abfa8c2e9da2c8
Rack aware host selection policy
I wrote 90% of this code, then realized that there's already a somewhat stale PR for the same issue open as #1565. The rationale behind this PRs is the same: cassandra running on public clouds tend to use what AWS calls "region" as cassandra datacenter, and "availability zone" as rack. A common desire is to keep tr...
diff --git a/AUTHORS b/AUTHORS index 50e173ad7..04a97c913 100644 --- a/AUTHORS +++ b/AUTHORS @@ -131,3 +131,4 @@ Sergei Karetnikov <sergei.karetnikov@gmail.com> Stefan Miklosovic <smiklosovic@apache.org> Adam Burk <amburk@gmail.com> Valerii Ponomarov <kiparis.kh@gmail.com> +Neal Turett <neal.turett@datadoghq.com> di...
2
1
0
[{"id": "G0", "claim": "The newly added checkList helper has too generic a name and, like iterCheck, does not verify how many hosts iter returns, so TestHostPolicy_TokenAware_RackAware may panic if the policy does not return all expected hosts; iterCheck and checkList should be replaced by an expectHosts helper that ma...
null
apache__cassandra-gocql-driver__168
apache/cassandra-gocql-driver
168
defect
142a1f6f39ef22539d94e075ff2125f376b7d244
91a482abd07459eacdfd7a1b952d75239c2d9642
Reprepare cassandra 2.x style batch if batch fails due to unprepared statement
I made a new PR with less commits. All this does is if a batch query was not prepared, it deletes the query from gocql's cache, then resends the batch (this has the side effect of also re-preparing the failed statement).
diff --git a/cassandra_test.go b/cassandra_test.go index 81d7692f9..f588822d1 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -572,3 +572,87 @@ func TestScanCASWithNilArguments(t *testing.T) { t.Fatalf("expected %v but got %v", foo, cas) } } + +func TestReprepareStatement(t *testing.T) { + session := cr...
4
2
1
[{"id": "G0", "claim": "The pull request should add a regression test for the unprepared-statement reprepare behaviour (ideally by restarting or simulating the failure against the test server).", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The test onl...
null
apache__cassandra-gocql-driver__1680
apache/cassandra-gocql-driver
1,680
defect
1c9ec8f651a2f47e2ac7d7b7e5030b1a6d7a2575
295a4a5cdfb38b56e7587c6a43d8eb65dd5d2e82
Always refresh ring on topology changes and reconnections
Currently, there are some cases where gocql does not refresh the ring during a control connection reconnection. If topology changes are happening on the cluster during the reconnection, some `NEW_NODE` and `REMOVED_NODE` protocol events might be missed. To fix this, every successful reconnection on the control conn...
diff --git a/AUTHORS b/AUTHORS index 7681639eb..6b3a84b16 100644 --- a/AUTHORS +++ b/AUTHORS @@ -134,3 +134,4 @@ Valerii Ponomarov <kiparis.kh@gmail.com> Neal Turett <neal.turett@datadoghq.com> Doug Schaapveld <djschaap@gmail.com> Steven Seidman <steven.seidman@datadoghq.com> +João Reis <joao.reis@datastax.com> diff...
10
9
4
[{"id": "G0", "claim": "The removals of the now-unused node-handling functions are placed in the wrong commits: addNewNode's removal should go in the 'remove unused code' commit, and handleNewNode/handleRemovedNode's removal should be part of the commit that stops using them.", "category": "maintainability", "verdict":...
null
apache__cassandra-gocql-driver__1694
apache/cassandra-gocql-driver
1,694
defect
4367d090becb1a32ec585e539e70e62e5235594e
e7e52764cb02a1d930ff07777e9b01cfbef5ca22
Fix potential crashes on deserealization
Fixes https://github.com/gocql/gocql/issues/1693 List of issues: - `unmarshalUDT`, can cause panic of data is not aligned with udt structure - `unmarshalMap`, potential wrong result if `readCollectionSize` return negative size - `unmarshalList`, otential wrong result if `readCollectionSize` return negative size ...
diff --git a/go.mod b/go.mod index a18289252..cd41b8430 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/golang/snappy v0.0.3 github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed github.com/kr/pretty v0.1.0 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/stre...
3
2
0
[{"id": "G0", "claim": "Do not introduce github.com/pkg/errors as a new dependency (it is unmaintained and would be forced on all users of gocql); use unmarshalErrorf with %s instead of all uses of the errors package in this pull request.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "intro...
null
apache__cassandra-gocql-driver__1714
apache/cassandra-gocql-driver
1,714
defect
642e867e60d0192912a3e747810724c1cbef04ca
5644ec00ce4e90452bf2e12a3c6c657f6d3f7bcd
Update Keyspace/Table name in prepared Query statement
Previously `gocql.TokenAwareHostPolicy` always used keyspace explicitly specified in `.Keyspace` in `ClusterConfig` regardless of the keyspace in the Query. This would mean that the token awareness feature would not work properly if the user did not specify `.Keyspace` in `ClusterConfig` or did a query to a different ...
diff --git a/cass1batch_test.go b/cass1batch_test.go index 43d73ae42..f8a796b62 100644 --- a/cass1batch_test.go +++ b/cass1batch_test.go @@ -53,7 +53,7 @@ func TestShouldPrepareFunction(t *testing.T) { } for _, test := range shouldPrepareTests { - q := &Query{stmt: test.Stmt} + q := &Query{stmt: test.Stmt, rout...
1
1
0
[{"id": "G0", "claim": "It is unclear whether example_keyspace_table_test.go is an example to be run by a user or a proper test, and if it is a test, the final check should be a proper assertion rather than a Println.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
apache__cassandra-gocql-driver__1719
apache/cassandra-gocql-driver
1,719
defect
7a686db6d366bb536c0abce24749af6b33cdd574
cb906bdb15a0f446a877dbd99ced6fc2b777d6e3
Increase default timeouts
Client timeouts need to be higher than server timeouts, so that work does not accumulate on the server with retries. This was not true by default, the gocql default timeout was lower than the Cassandra default timeout. Closes https://github.com/gocql/gocql/issues/1671 Closes https://github.com/gocql/gocql/issues...
diff --git a/CHANGELOG.md b/CHANGELOG.md index 685f9931f..b704ae9b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 information about that every time this information is received. (#1714) ### Changed - Tracer created wi...
1
1
0
[{"id": "G0", "claim": "The new comment for ConnectTimeout should say 'within the connectTimeout period' rather than 'within the Timeout period', to avoid conflating it with the Timeout setting.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
apache__cassandra-gocql-driver__1764
apache/cassandra-gocql-driver
1,764
defect
34fdeebefcbf183ed7f916f931aa0586fdaa1b40
7353ad686b94cd1702dec597053a29cc5f91a326
CASSGO-7 Change Batch API to be consistent with Query()
According to issue #1187, I have refactored the Query() method for the batch and implemented the Exec() method for the batch structure to save the general pattern of the query execution, and saved the older method (session.ExecuteBatch()) for backward compatibility. This means the batch for now behaves the same way a...
diff --git a/example_batch_test.go b/example_batch_test.go index b3e767ac4..62fcf9335 100644 --- a/example_batch_test.go +++ b/example_batch_test.go @@ -3,12 +3,14 @@ package gocql_test import ( "context" "fmt" - "github.com/gocql/gocql" "log" + "testing" + + "github.com/gocql/gocql" ) // Example_batch demon...
6
5
1
[{"id": "G0", "claim": "Add a new Session.Batch() with the same functionality as Session.NewBatch() and keep Session.NewBatch() but marked deprecated, so users can transition to the new name without breakage.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim":...
null
apache__cassandra-gocql-driver__1767
apache/cassandra-gocql-driver
1,767
defect
34fdeebefcbf183ed7f916f931aa0586fdaa1b40
bef3c1d8fc39e8071e5c18bdf8d74181ee22b502
CASSGO-41 Fix deadlock in refresh debouncer stop
fix #1752
diff --git a/host_source.go b/host_source.go index a0b7058d7..702463bb8 100644 --- a/host_source.go +++ b/host_source.go @@ -747,25 +747,27 @@ const ( // debounces requests to call a refresh function (currently used for ring refresh). It also supports triggering a refresh immediately. type refreshDebouncer struct { ...
1
1
1
[{"id": "G0", "claim": "The context-based stop mechanism is an abuse of contexts; instead keep the old quit-channel behavior with a small change: add a `done chan struct{}` closed via `defer close(done)` in `flusher`, keep `stop()` as it was except drop the send to `quit` and just close it, then wait with `<-done` for ...
null
apache__cassandra-gocql-driver__1768
apache/cassandra-gocql-driver
1,768
defect
34fdeebefcbf183ed7f916f931aa0586fdaa1b40
970b6622ad0d016ca749e9d09743aba6af179d0f
CASSGO-12 Remove deprecated features
This PR removes some features that are marked as "Deprecated". Such as: * global var Timeout limit; `TimeoutLimit` was removed because it was always equal to 0 and the only condition where it was used was always false by default. * `MustParseConsistency()` function; It was removed due to its depr...
diff --git a/cassandra_test.go b/cassandra_test.go index 691d25cdd..6746057f0 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -20,7 +20,7 @@ import ( "time" "unicode" - inf "gopkg.in/inf.v0" + "gopkg.in/inf.v0" ) func TestEmptyHosts(t *testing.T) { @@ -2199,45 +2199,6 @@ func TestGetColumnMetadata(t...
4
4
4
[{"id": "G0", "claim": "The field_names and field_types columns that the materialized-views metadata query newly selects do not exist on the queried table, so the query would fail.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The pull request's te...
null
apache__cassandra-gocql-driver__1791
apache/cassandra-gocql-driver
1,791
defect
34fdeebefcbf183ed7f916f931aa0586fdaa1b40
c6549ea81defda40c716073f76a1daade297aec2
CASSGO-13 Add support for cassandra 4.0 table options
Cassandra 4.0 has some minor table metadata changes that need to be accounted for: read_repair_chance is replaced with read_repair dclocal_read_repair_chance has been removed additional_write_policy has been added In the PR implemented backward compatibility with previous versions, and added new types support. To...
diff --git a/cassandra_test.go b/cassandra_test.go index 691d25cdd..19b4b8fa3 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -2259,14 +2259,19 @@ func TestMaterializedViewMetadata(t *testing.T) { expectedChunkLengthInKB := "16" expectedDCLocalReadRepairChance := float64(0) expectedSpeculativeRetry := "...
4
4
1
[{"id": "G0", "claim": "Keeping ReadRepairChance in the expected MaterializedViewMetadata (and presumably still populating it) is wrong because read_repair_chance was removed from Cassandra 4.0.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "extensi...
null
apache__cassandra-gocql-driver__1793
apache/cassandra-gocql-driver
1,793
defect
974fa1211ccef10a418966fd7b00984a39ed9232
0444ee3479b4ca9d469148b51f1e7261051a558f
CASSGO-4 Support of sending queries to the specific node
# Overview This PR provides a mechanism that allows users to specify on which node the query will be executed. It is not a typical use case, but it makes sense with virtual tables. For example, when we want to retrieve metrics for a specific node, we have to send queries to the associated system view of this node....
diff --git a/cassandra_test.go b/cassandra_test.go index 797a7cf7f..8c1439a81 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -3253,7 +3253,6 @@ func TestUnsetColBatch(t *testing.T) { } var id, mInt, count int var mText string - if err := session.Query("SELECT count(*) FROM gocql_test.batchUnsetInsert...
9
4
3
[{"id": "G0", "claim": "Asks whether the new API should allow other routing preferences (a single data center/rack, targeting a specific shard) and allow routing to a different host during retry via a HostSelectionPolicy or similar.", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"},...
null
apache__cassandra-gocql-driver__1801
apache/cassandra-gocql-driver
1,801
defect
a67eebb6d94074a2eb33b3783f8bacca1c22fcab
6c27717f5c639e4ddcc6afb2555e7e61f5149bf5
CASSGO-19 Don't restrict server authenticator in PasswordAuthenticator
Currently gocql will only allow authenticating with authenticators defined in defaultApprovedAuthenticators in conn.go. There have been multiple occurrences of implementers needing to update this list, either when a vendor would like to add their authenticator, or a new authenticator being added. It would prob...
diff --git a/conn.go b/conn.go index 3daca6250..2a233d252 100644 --- a/conn.go +++ b/conn.go @@ -43,25 +43,11 @@ import ( "github.com/gocql/gocql/internal/streams" ) -var ( - defaultApprovedAuthenticators = []string{ - "org.apache.cassandra.auth.PasswordAuthenticator", - "com.instaclustr.cassandra.auth.SharedSec...
1
1
0
[{"id": "G0", "claim": "A comment documenting the behavior could also be added on the PasswordAuthenticator type (and its AllowedAuthenticators field) in conn.go, not only in doc.go, so that nil/empty AllowedAuthenticators meaning any server authenticator is allowed shows up on pkg.go.dev and in IDEs.", "category": "do...
null
apache__cassandra-gocql-driver__1836
apache/cassandra-gocql-driver
1,836
defect
974fa1211ccef10a418966fd7b00984a39ed9232
f606c216bcf667c34e8e1897cbf958a613ae9acc
CASSGO-49 fix for the cassandra version unmarshal
Fix for the #910. This PR fixes issue, when the driver is unable to unmarshal Cassandra version, which contains additional annotation.
diff --git a/host_source.go b/host_source.go index a0bab9ad0..eb1d8a72a 100644 --- a/host_source.go +++ b/host_source.go @@ -56,6 +56,7 @@ const ( type cassVersion struct { Major, Minor, Patch int + AdditionalNotation string } func (c *cassVersion) Set(v string) error { @@ -87,13 +88,29 @@ func (c *cassVersio...
2
2
1
[{"id": "G0", "claim": "The new field AdditionalNotation should be named Qualifier, since Cassandra calls the part after the dash a qualifier.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "After parsing a qualifier on the minor version the code...
null
apache__cassandra-gocql-driver__1837
apache/cassandra-gocql-driver
1,837
defect
953e0df999cabb3f5eef714df9921c00e9f632c2
2d83ec871c457827a39a6aef5cbe0ff10f5749e7
CASSGO-26 consistency serial was added
Closes #1832 With the previous implementation, setting consistency SERIAL for Paxos reads was impossible. Fixed in this PR
diff --git a/frame.go b/frame.go index d374ae574..54ad6776f 100644 --- a/frame.go +++ b/frame.go @@ -192,6 +192,8 @@ const ( type Consistency uint16 +type SerialConsistency = Consistency + const ( Any Consistency = 0x00 One Consistency = 0x01 @@ -202,6 +204,8 @@ const ( LocalQuorum Consisten...
5
4
1
[{"id": "G0", "claim": "The pull request should remove `SerialConsistency` altogether and use `Consistency` everywhere with appropriate checks, since the alias type no longer has a reason to exist.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The pull re...
null
apache__cassandra-gocql-driver__1844
apache/cassandra-gocql-driver
1,844
defect
63b6d7830710a0c6c5411c08bf16d38cb88d2a8a
0f254c1a4dcb120ffec81554e1c9a8767ab5a8d8
CASSGO-33 snappy has been moved to a separate package
This PR should be reviewed right after https://github.com/apache/cassandra-gocql-driver/pull/1822 is merged.
diff --git a/CHANGELOG.md b/CHANGELOG.md index 351b7311f..603e6e855 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Moved the Snappy compressor into its own separate package. + This allows users to inclu...
3
2
0
[{"id": "G0", "claim": "The second line of the new CHANGELOG.md entry should be dropped to keep the changelog list brief, since users can open the linked JIRA for details.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new file snappy/snappy-c...
null
apache__cassandra-gocql-driver__1875
apache/cassandra-gocql-driver
1,875
defect
c75ff5f282183704b0921610d55ff3f031f45737
8ea1c0b3f1a6458bb08b360c71dc819f678010d1
CASSGO-50 Endless query execution fix proposal
I've researched possible endless query execution when `HostSelectionPolicy` returns the same downed host ([CASSGO-50](https://issues.apache.org/jira/browse/CASSGO-50)) and propose three approaches to prevent it. - Wrap `hostIter` to prevent it from returning downed host before executing the query. e.g. ``` ho...
diff --git a/connectionpool.go b/connectionpool.go index 9b8295e70..e27b55a7c 100644 --- a/connectionpool.go +++ b/connectionpool.go @@ -246,6 +246,9 @@ func (p *policyConnPool) getPool(host *HostInfo) (pool *hostConnPool, ok bool) { func (p *policyConnPool) getPoolByHostID(hostID string) (pool *hostConnPool, ok bool)...
3
3
1
[{"id": "G0", "claim": "Nil-ing out the connection pool in getPoolByHostID is the wrong fix for the endless execution: it appears to make the specified pool usable for only a single query and ties the fix to the number of connection pools; the preferred fix is for the host to be returned only once, ideally in the inter...
null
apache__cassandra-gocql-driver__1892
apache/cassandra-gocql-driver
1,892
defect
f5fe4834ef2d97982d8f471c15d8cfd6b851373f
7a91ba43ce47a017a8f9ad765956a58c87a2a579
CASSGO-71 Add way to create HostInfo objects for testing purposes
Also renamed NewHostInfo to NewHostInfoFromContactPoint, this isn't a breaking change because this function was exported recently and no release has gone out since then. What is a breaking change is making `host.SetHostID` private, I don't see why we would let users modify the host id
diff --git a/CHANGELOG.md b/CHANGELOG.md index ea0d600c5..61e3cdee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Query.SetKeyspace(), Query.WithNowInSeconds(), Batch.SetKeyspace(), Batch.WithNowInSeconds() (CASSGO-1) ...
2
1
0
[{"id": "G0", "claim": "The new function should be named NewHostInfoFromAddrPort instead of NewHostInfoFromContactPoint.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The PR should also provide the same method on *Session so host info creation ...
null
apache__cassandra-gocql-driver__1895
apache/cassandra-gocql-driver
1,895
defect
be35a5b3fd83ba7de23b7f3dc22e6d04eda37441
c7e5cee1e400e3344635d24d826d2790c6f657d1
CASSGO-6 Accept peers with empty rack
This fixes #1706.
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6262875bc..227e729d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Don't panic in MapExecuteBatchCAS if no `[applied]` column is returned (CASSGO-42) - Fix deadlock in ref...
4
1
1
[{"id": "G0", "claim": "The error returned by iter.Close() in setupConn should be handled instead of discarded.", "category": "correctness", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The h.rack == \"\" condition should be removed from HostInfo.update since empty-string rac...
null
apache__cassandra-gocql-driver__1897
apache/cassandra-gocql-driver
1,897
defect
722707e3df954a43c5aa708de8569fff38f1d5a7
49efc8825c091933e384f82f1bd6c59421a65fd0
CASSGO-80 Update example and test code for 2.0
Updates example and test code according to changes in 2.0.0 release (mostly deprecations). Also adds examples for new 2.0 features.
diff --git a/batch_test.go b/batch_test.go index 7f7d00253..57eafd640 100644 --- a/batch_test.go +++ b/batch_test.go @@ -93,10 +93,10 @@ func TestBatch_WithNowInSeconds(t *testing.T) { t.Fatal(err) } - b := session.NewBatch(LoggedBatch) + b := session.Batch(LoggedBatch) b.WithNowInSeconds(0) b.Query("INSERT ...
3
1
0
[{"id": "G0", "claim": "Consider removing the ProtoVersion assignment from the example code so users are not encouraged to hardcode the protocol version in their applications.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Consider also adding an example f...
null
apache__cassandra-gocql-driver__1899
apache/cassandra-gocql-driver
1,899
defect
a9bfe80d8e6fad320c0737c9484056e9de7bef74
c0f14a162855de40d8d20726d016ba279b6bc91a
CASSGO-82 CASSGO-83 fix tinyint decode bug and vector decode bug with SliceMap
CASSGO-82 Tinyint unmarshal silently errors and unmarshals tinyint values as 0 in some situations. This PR also removes other cases of silent errors in decode functions. CASSGO-83 fix issue where reading vectors with SliceMap is not possible
diff --git a/integration_test.go b/integration_test.go index 18acaf4af..bd6ccb5cc 100644 --- a/integration_test.go +++ b/integration_test.go @@ -30,9 +30,15 @@ package gocql // This file groups integration tests where Cassandra has to be set up with some special integration variables import ( "context" + "fmt" + "m...
4
3
2
[{"id": "G0", "claim": "The change making inetType.Zero() return net.IP{} instead of net.IP(nil) is unexplained and wrong, since the zero value for a slice like net.IP is nil.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The vector unmarshal error...
null
apache__cassandra-gocql-driver__190
apache/cassandra-gocql-driver
190
defect
2492f1222cf94016b5ee0ac0be17ad9b1791b033
f56b352c906055249893c8e8fb4648f96ac9add2
Added LRU Cache for Prepared statements to prevent memory leaks
This is the third attempt at issue #184. This merge request uses the groupcache/lru package as an external dependency since the implementation in the package is simple and generic enough to use out of the box inside gocql. I have written a few integration tests. Please let me know if these tests are insufficient and I...
diff --git a/cassandra_test.go b/cassandra_test.go index b82883153..cec6d9402 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -10,6 +10,7 @@ import ( "reflect" "sort" "speter.net/go/exp/math/dec/inf" + "strconv" "strings" "sync" "testing" @@ -583,9 +584,10 @@ func injectInvalidPreparedStatement(t ...
9
7
1
[{"id": "G0", "claim": "Asks whether the groupcache LRU has no internal locking (is not safe for concurrent access), questioning whether the manual stmtsLRU mutex is necessary.", "category": "correctness", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The cache tests duplicate t...
null
apache__cassandra-gocql-driver__1912
apache/cassandra-gocql-driver
1,912
defect
a6e8291f5723b693b09cbeff244c603dd5103222
eb0375d96a0df77386dc87a3caea25872944f90d
CASSGO-90 Don't collect host metrics if a query/batch observer is not provided
~~In 2.0.0-rc1 we got rid of the query object pooling and now the extra allocs associated with the code that is collecting QueryMetrics is 1 of the factors that are leading to a small performance regression.~~ ~~Since the majority of the users don't use Query Metrics, it makes more sense to make these opt-in.~~ ~...
diff --git a/CHANGELOG.md b/CHANGELOG.md index 19f353ad8..1935d6f85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### 2.0.0 - Remove release date from changelog and add 2.0.0-rc1 (CASSGO-86) +- Make Query Metrics (Lat...
2
2
1
[{"id": "G0", "claim": "The `nil` prefix of `nilHostMetrics`/`nilQueryMetricsImpl` is misleading because the values are not actually nil; an `empty` prefix would be better.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new godoc on Iter.Att...
null
apache__cassandra-gocql-driver__1913
apache/cassandra-gocql-driver
1,913
defect
5c6075151a551f3e985b3647288b82fe01aef657
bc30a7e067c78973c7f273f72d549ae5a455074e
CASSGO-91 Prefer connection address over system local addresses
There is an unintended change in 2.0-rc1 causing the driver to prefer system table addresses over the connection address which breaks deployments that rely on this behavior from 1.x. This patch fixes this and keeps the behavior the same as it was in 1.x.
diff --git a/CHANGELOG.md b/CHANGELOG.md index d8a3da0a7..2fa50aa00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Driver closes connection when timeout occurs (CASSGO-87) - Do not set beta protocol flag when using v5...
2
1
0
[{"id": "G0", "claim": "In newHostInfoFromRow the connect address will now never change from defaultAddr, so every host would end up with the same address and you could never connect to another host.", "category": "correctness", "verdict": "opposed", "priority": "P0", "scope": "introduced"}, {"id": "G2", "claim": "More...
null
apache__cassandra-gocql-driver__1915
apache/cassandra-gocql-driver
1,915
defect
f3e2b397adaaf5f8742068dfbd88958c824934ee
9d70df485303926eb280ec386867e2824eb586c3
CASSGO-92: Add a public method to retrieve StatementMetadata and LogField methods
StatementMetadata can be called on a session to get the bind, result, and pk information for a given query. Previously this wasn't publicly exposed but is necessary for some implementations of HostSelectionPolicy like token-aware. This might also be useful for CI tooling or runtime analysis of queries and the types of ...
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fa50aa00..1bbd2fdd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic ...
6
3
1
[{"id": "G0", "claim": "The NewLogField(name string, value interface{}) entry point boxes every value and the reviewer believes that will result in extra allocations, so the private typed constructors (newLogField, newLogFieldIp, etc.) should be made public instead; if an any-value variant is kept it should carry a doc...
null
apache__cassandra-gocql-driver__1936
apache/cassandra-gocql-driver
1,936
defect
5361aa31cd6339b61d77b33b1b41b3bcbf5895fb
3d2ac856b4e5ea9b02d6d0ad9e7e61a498d11d4e
CASSGO-113: Add dedicated error types for more error codes
Add dedicated error types for all generic server error codes Introduce distinct concrete types for all server error codes that were previously returned as generic errorFrame values: RequestErrOverloaded, RequestErrBootstrapping, RequestErrInvalid, RequestErrConfig, RequestErrCredentials, RequestErrProtocol, Requ...
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5832fa177..ea8782bdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Add RequestErrOverloaded and RequestErrBootstrapping for dedicated error handling (CASSGO-11...
2
2
0
[{"id": "G0", "claim": "The new CHANGELOG entry should be moved to the bottom of the Added section so entries stay in the order in which the patches were committed.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "All the remaining generic server er...
null
apache__cassandra-gocql-driver__1939
apache/cassandra-gocql-driver
1,939
defect
b86c662e14e223d2c85b68c05b537f52e25ed9d6
276afe6466919f7accf4ce35a98cfc6d11cbdd05
CASSGO-115 Iter.MapScan is unable to scan data of user-defined types fix
Previously, Iter.MapScan was unable to scan columns of user-defined types due to a bug which leaded to never updated destination variable. With this patch it is handled correctly. Patch by Bohdan Siryk; reviewed by TBD for CASSGO-115
diff --git a/cassandra_test.go b/cassandra_test.go index d33de21ce..e02029a35 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -4617,3 +4617,46 @@ func TestNewSession_SchemaListenersValidation(t *testing.T) { }) } } + +func TestIterMapScanUDT(t *testing.T) { + session := createSession(t) + defer session....
1
1
0
[{"id": "G0", "claim": "Instead of the deferred `*iptr = v` assignment inside `UDTTypeInfo.Unmarshal`, the code in `case *map[string]interface{}:` should be extracted into a private method and a `case *interface{}:` added that calls it, which the reviewer thinks would be easier to read and less error prone.", "category...
null
apache__cassandra-gocql-driver__218
apache/cassandra-gocql-driver
218
defect
0396db5edd504879f70df1ece6f28fea7e684f13
3220a805a3319b8c0b769f479ac7cd0d013e4ed6
Varint support
Add support for CQL varint type. Varints are signed integers encoded using two's complement. When marshaling, gocql trims the encoded bytes down to the minimum required to encode the integer value (e.g. if you encode a varint value that can fit in one byte, gocql will actually only send 1 byte). This matches the behav...
diff --git a/AUTHORS b/AUTHORS index 67163af93..c12e73ee8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -25,4 +25,5 @@ Stefan Radomski <gibheer@zero-knowledge.org> Josh Wright <jshwright@gmail.com> Jacob Rhoden <jacob.rhoden@gmail.com> Ben Frye <benfrye@gmail.com> -Fred McCann <fred@sharpnoodles.com> \ No newline at end of ...
6
3
1
[{"id": "G0", "claim": "The varint test vectors need to come from other clients' test suites so interoperability with the varint representation on other platforms is actually verified, and the SliceMap test should use a bigger, more meaningful varint test value.", "category": "testing", "verdict": "supported", "priorit...
null
apache__cassandra-gocql-driver__340
apache/cassandra-gocql-driver
340
defect
5abf8446a1c800833f63867d12d61ae656c0f028
abddf98fe1904808357ca7d0244a407da8f0c920
Token partitioners and a token ring
This PR adds implementations of token partitioners for the 3 cassandra partitioning strategies as well as a token ring implementation. These implementations are mostly based on the DataStax cassandra drivers, with some references to the cassandra codebase itself. My original Murmur3Token implementation depended on gith...
diff --git a/token.go b/token.go new file mode 100644 index 000000000..f25a7f3c8 --- /dev/null +++ b/token.go @@ -0,0 +1,315 @@ +// Copyright (c) 2015 The gocql Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gocql + +imp...
6
4
2
[{"id": "G0", "claim": "RandomToken should avoid embedding *big.Int as its exported representation.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "BenchmarkMurmur3H1 should call b.ResetTimer() before its timing loop.", "category": "testing", "verdict": "...
null
apache__cassandra-gocql-driver__353
apache/cassandra-gocql-driver
353
defect
bc6c54ef3b3fc0bdc88a85818079ed117f20cd50
4eb0e0532e36d084257fa3879891c22e3d4e53c5
Add with serial consistency support
Add an option to Query to set the serial consistency for the conditional update phase of a query. closes #343
diff --git a/cassandra_test.go b/cassandra_test.go index b58c1f349..672b82f7d 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -251,6 +251,7 @@ func TestCAS(t *testing.T) { session := createSession(t) defer session.Close() + session.cfg.SerialConsistency = LocalSerial if err := createTable(session, `...
2
2
2
[{"id": "G0", "claim": "Query.SerialConsistency should not panic on an invalid consistency level; the library refrains from panicking and Cassandra will return an error anyway, so the panic should be removed.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim":...
null
apache__cassandra-gocql-driver__669
apache/cassandra-gocql-driver
669
defect
15590c2435b4b535df5c7073cc7c08e37b27f811
e204266169e29b64fdef1918f48a51344ff9dc5f
Fix 100ms sleep when creating session.
hostConnPool.fill() was synchronously filling the pool and calling fillingStopped(), which sleeps for ~100ms. - don't synchronously fill the entire conn pool (connect once synchronously, then fill the rest in a separate goroutine) - only sleep in hostConnPool.fillingStopped if fill() encountered an error - fix clea...
diff --git a/cassandra_test.go b/cassandra_test.go index 31559b062..ce7962d59 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -88,9 +88,6 @@ func TestInvalidPeerEntry(t *testing.T) { "169.254.235.45", ) - // clean up naughty peer - defer session.Query("DELETE from system.peers where peer == ?", "169.25...
3
1
1
[{"id": "G0", "claim": "TestTokenAwareConnPool expects pool creation to be synchronous for the initial connect, so the tests need adjusting before the pull request is merged.", "category": "testing", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The retry loop added to TestTok...
null
apache__cassandra-gocql-driver__798
apache/cassandra-gocql-driver
798
defect
ffae44103aa14ada9e2b342329f44ce354f399fd
52bf3ffcbda95b9917685c17f133397e0cd3f44a
adding AddressTranslator interface and impl for use in ec2
This change introduces the AddressTranslator interface, which is intended for use during discovery and node-event processing to translate peer addresses of nodes. The primary use -- which is driving the change -- is to translate public IPs to private IPs (when possible) in ec2. The ec2 translator will be implemented el...
diff --git a/.travis.yml b/.travis.yml index a798d3e68..60338eb16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,11 @@ go: - 1.6 - 1.7 +# hostname setup for ec2_test +before_install: + - sudo chmod uga+w /etc/hosts + - sudo echo -e "\n10.10.220.253\tec2.test.host.gocql\n10.10.220.254\tec2.test.host.g...
7
7
4
[{"id": "G0", "claim": "The EC2 multi-region address translator is easy to implement, implementation-specific and does not directly relate to Cassandra, so it should not be included in the driver library.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Th...
null
apache__cassandra-gocql-driver__888
apache/cassandra-gocql-driver
888
defect
f8b6dcaf4f8a770652c11e7e94b517fcb706fce8
f2df755695cd156cec15296dba1f3edb8fe85d1b
Fix more hostinfo
## Purpose This is the fixed version of PR #860 (See #869) During initial discovery gocql will only use the user supplied address when picking a control host. Peers that are discovered will have an `rpc_address` or `peer` address which will be used to connect. ```go // session.go 186: for _, host := range hos...
diff --git a/cassandra_test.go b/cassandra_test.go index 4564be197..8702a4d6f 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -67,7 +67,7 @@ func TestRingDiscovery(t *testing.T) { if *clusterSize != size { for p, pool := range session.pool.hostConnPools { - t.Logf("p=%q host=%v ips=%s", p, pool.host,...
11
11
2
[{"id": "G0", "claim": "hostInfoFromMap should return (*HostInfo, error) instead of (error, *HostInfo) to be consistent with Go code style.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The host should be allocated as &HostInfo{port: r.session.cfg.Port}...
null
apache__cassandra-gocql-driver__889
apache/cassandra-gocql-driver
889
defect
f8b6dcaf4f8a770652c11e7e94b517fcb706fce8
0514f4cd83ef25ecc49115225e0728ba308cd9fb
CreateSession() will now attempt to resolve all host names
## Purpose `CreateSession()` would exit prematurely if it encountered a hostname it could not resolve. With this patch all host names will be resolved before an error is returned. fixes #873 ## Implementation * `addrsToHosts()` will log and continue to the next host if `hostInfo()` returns a `DNSError` * Added a...
diff --git a/session.go b/session.go index 503d6c2e4..8489709ae 100644 --- a/session.go +++ b/session.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + "net" "strings" "sync" "sync/atomic" @@ -76,16 +77,23 @@ var queryPool = &sync.Pool{ } func addrsToHosts(addrs []string, defaultPort int) ([]*HostInfo...
2
2
1
[{"id": "G0", "claim": "The added DNS-error log line Logger.Printf(\"gocql: %v\\n\", err) should be improved or removed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Tests should be added that confirm the new DNS-resolution fallback behavior f...
null
apache__cassandra-gocql-driver__903
apache/cassandra-gocql-driver
903
defect
7e9748ccda7fd5135a7db13ba03f09cad0c86bed
b3831d3f0931e205e0f2e51cd97c98c3153c1216
Support for UnSet columns
# Purpose Adding support for the UNSET_VALUE in gocql. See #861 and [Cassandra Jira issue](https://issues.apache.org/jira/browse/CASSANDRA-7304) ## Tests to Add: - [x] Insert Unset column does not replace existing column - [x] Insert Batch with unset
diff --git a/common_test.go b/common_test.go index 92cd15aba..76a65e0d2 100644 --- a/common_test.go +++ b/common_test.go @@ -4,16 +4,16 @@ import ( "flag" "fmt" "log" + "net" "strings" "sync" "testing" "time" - "net" ) var ( flagCluster = flag.String("cluster", "127.0.0.1", "a comma-separated l...
5
2
1
[{"id": "G0", "claim": "The isUnset branch in writeQueryParams may not need to be there, as the author is not sure how it is used.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The exported UnsetColumn type with an UnsetValue() constructor should not be...
null
apache__cassandra-java-driver__1666
apache/cassandra-java-driver
1,666
defect
6cf075fc68eccb06e38e3e26deee75f491fa0fe2
8743742b83b25809f8cc653ae2c7d5d2294bd898
JAVA-3061 Re-introduce an improved CqlVector, add support for accessing vectors directly as float arrays
Fixes in the same vein as #1643 adapted to play nicely with recent changes to the Java types representing CQL vectors.
diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/data/CqlVector.java b/core/src/main/java/com/datastax/oss/driver/api/core/data/CqlVector.java new file mode 100644 index 00000000000..252127241ff --- /dev/null +++ b/core/src/main/java/com/datastax/oss/driver/api/core/data/CqlVector.java @@ -0,0 +1,181 @@...
4
3
1
[{"id": "G0", "claim": "Add tests around the wrapping-constructor behavior of CqlVector, including tests that modifying the vals var-args array in the other constructor is not reflected in the CqlVector.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "en...
null
apache__cassandra-java-driver__1689
apache/cassandra-java-driver
1,689
defect
60c9cbc51f29c3ae262f9ce53dfd923600efaab6
2eb4cf7819214c6751476ba9d0264004642241f1
add support for publishing percentile time series for the histogram m…
…etrics cql-requests, cql-messages and throttling delay. Motivation: Histogram metrics is generating too many metrics overloading the promethous servers. if application has 500 Vms and 1000 cassandra nodes, The histogram metrics generates 100*500*1000 = 50,000,000 time series every 30 seconds. This is just too mu...
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/config/DseDriverOption.java b/core/src/main/java/com/datastax/dse/driver/api/core/config/DseDriverOption.java index 74907c177b6..35826b9d8e1 100644 --- a/core/src/main/java/com/datastax/dse/driver/api/core/config/DseDriverOption.java +++ b/core/src/main/j...
8
8
1
[{"id": "G0", "claim": "The PR should also provide a way to turn off the percentile histogram generation (publishPercentileHistogram), ideally as one configuration option that switches aggregable histogram generation on/off for all metric flavors, since computing and publishing those buckets when they are ignored is wa...
null
apache__cassandra-java-driver__1719
apache/cassandra-java-driver
1,719
defect
d990f92ba01c3ecaaa3f31a0f1fb327f77a96617
85111b34e1a45a36c1d979a574ac21f94f561fbf
JAVA-3116: update surefire/failsafe to 3.0.0 to fix issue running tests with specified jvm
Additionally: - Set --jvm_version=8 when running dse 6.8.19+ with graph workloads (DSP-23501) - Update commons-configuration2 to 2.9.0 + deps in BundleOptions to support java17 - Update felix framework version to 7.0.1 for java17 (FELIX-6287) - Pick up newer bndlib for ArrayIndexOutOfBounds error printed with OsgiG...
diff --git a/osgi-tests/src/test/java/com/datastax/oss/driver/internal/osgi/support/BundleOptions.java b/osgi-tests/src/test/java/com/datastax/oss/driver/internal/osgi/support/BundleOptions.java index 6e7d82787f4..aa62b623f4b 100644 --- a/osgi-tests/src/test/java/com/datastax/oss/driver/internal/osgi/support/BundleOpti...
1
1
0
[{"id": "G0", "claim": "The --jvm_version handling is duplicated across the two instances of start() in CcmBridge.java, which the reviewer flags as ugly but tolerable for now since abstracting over the jvmArgs field and the node argument would be awkward.", "category": "maintainability", "verdict": "supported", "priori...
null
apache__cassandra-java-driver__1896
apache/cassandra-java-driver
1,896
defect
12e3e3ea027c51c5807e5e46ba542f894edfa4e7
2eae1c4ce74ef488ee1467040feadd436c628024
JAVA-3142: Ability to optionally specify remote dcs for deterministic failovers when remote dcs are used in query plan
Ability to specify ordering of remote dc's via new configuration for deterministic failovers. https://datastax-oss.atlassian.net/browse/JAVA-3142 **Motivation** The driver uses the remote contact points(in no particular order) when a Query plan is built if max-nodes-per-remote-dc is used. Explicitly specifying...
diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java b/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java index 4c0668570b2c..16d604329230 100644 --- a/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java +++ b/c...
13
11
0
[{"id": "G0", "claim": "The javadoc sentence for the new preferred-remote-dcs option should end with a period after 'greater than 0'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The field preferredRemoteLocalDcs should be renamed to preferredRe...
null
apache__cassandra-java-driver__1916
apache/cassandra-java-driver
1,916
defect
ea2e475185b5863ef6eed347f57286d6a3bfd8a9
c66d98cef3242cac95d68e90aeae4362b94c34d5
CASSANDRA-19457: Object reference in Micrometer metrics prevent GC from reclaiming Session instances
It is leaked by micrometer gauge initialization. I used the following `application.conf`, which includes all node and session level metrics, and the memory leak is gone. ``` datastax-java-driver.advanced.metrics { session.enabled = [ # The number and rate of bytes sent for the entire session (exposed as a M...
diff --git a/metrics/micrometer/src/main/java/com/datastax/oss/driver/internal/metrics/micrometer/MicrometerMetricUpdater.java b/metrics/micrometer/src/main/java/com/datastax/oss/driver/internal/metrics/micrometer/MicrometerMetricUpdater.java index 7a4a27991e3..53e535fe02c 100644 --- a/metrics/micrometer/src/main/java/...
7
6
4
[{"id": "G0", "claim": "The change leads to some missing metrics such as connected-nodes, so another way to fix the leak is needed.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The supplier fields added to MicrometerNodeMetricUpdater and Micromete...
null
apache__cassandra-java-driver__1950
apache/cassandra-java-driver
1,950
defect
a17f7be614a09ab81bc2982b7f7ab3a123b4ab28
d21806381c6f0a9312d72bc44e6a97424bd96171
JAVA-3149: Support request cancellation in request throttler
Fix [JAVA-3149](https://datastax-oss.atlassian.net/browse/JAVA-3149).
diff --git a/core/revapi.json b/core/revapi.json index 318e29709ec0..5250ad798a5f 100644 --- a/core/revapi.json +++ b/core/revapi.json @@ -6956,6 +6956,11 @@ "old": "method java.lang.Throwable java.lang.Throwable::fillInStackTrace() @ com.fasterxml.jackson.databind.deser.UnresolvedForwardReference", "...
2
2
1
[{"id": "G0", "claim": "Add a default no-op implementation of the new signalCancel method in the RequestThrottler interface so that custom throttler implementations stay API-compatible.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Apply the suggested c...
null
apache__cassandra-java-driver__1957
apache/cassandra-java-driver
1,957
defect
d0a1e44a4415c7a0489f8c35ee9ce49e20d7bc61
d29d61384b86dda56fabe87adb4eddf76d882df5
Reduce lock held duration in ConcurrencyLimitingRequestThrottler
It might take some (small) time for callback handling when the throttler request proceeds to submission. Before this change, the throttler proceed request will happen while holding the lock, preventing other tasks from proceeding when there is spare capacity and even preventing tasks from enqueuing until the callbac...
diff --git a/core/src/main/java/com/datastax/oss/driver/internal/core/session/throttling/ConcurrencyLimitingRequestThrottler.java b/core/src/main/java/com/datastax/oss/driver/internal/core/session/throttling/ConcurrencyLimitingRequestThrottler.java index e8f27467c6fe..53104b654ddb 100644 --- a/core/src/main/java/com/da...
5
4
1
[{"id": "G0", "claim": "The new concurrency tests coordinate registration threads with a 5ms sleep, which may not be deterministic and could be sensitive to CI timing; a CountDownLatch-based approach would be more reliable.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id"...
null
apache__cassandra-java-driver__1958
apache/cassandra-java-driver
1,958
defect
9cfb4f6712e392c1b6c87db268565fd3b27d0c5c
c58cad0af2c684dd1ab92d9658447cbbbdf2e46a
Refactor integration tests to support multiple C* distributions
Refactored integration tests to be able to support multiple C* distributions (not only DSE vs. OSS).
diff --git a/Jenkinsfile b/Jenkinsfile index 4cc20d79604..f5a48b89f96 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,7 +61,7 @@ def initializeEnvironment() { . ${JABBA_SHELL} jabba which 1.8''', returnStdout: true).trim() - sh label: 'Download Apache CassandraⓇ or DataStax Enterprise',script: '''#!/bin/...
5
5
1
[{"id": "G0", "claim": "The new static field `distribution` should be named `DISTRIBUTION` to stay consistent with the all-caps naming convention used for other static variables in CcmBridge.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Suppor...
null
apache__cassandra-java-driver__1964
apache/cassandra-java-driver
1,964
defect
9cfb4f6712e392c1b6c87db268565fd3b27d0c5c
eae620d44f5c70ef48975e80bf0fc18a23791692
CASSANDRA-19932: Allow to define extensions while creating table
Fixes [CASSANDRA-19932](https://issues.apache.org/jira/browse/CASSANDRA-19932).
diff --git a/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/schema/RelationOptions.java b/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/schema/RelationOptions.java index 022562def817..a8e3febf3714 100644 --- a/query-builder/src/main/java/com/datastax/oss/driver/api/querybuil...
3
3
2
[{"id": "G0", "claim": "withExtensions should be exposed on CreateTableWithOptions rather than RelationOptions, since extensions appear to be intended for table creation only and may not even work on materialized views.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1...
null
apache__cassandra-java-driver__1998
apache/cassandra-java-driver
1,998
defect
7bc085bdfb337b91255573bc3e130815e280954a
3221c7ee31255d31dbd7b0243cf13b6c1c91a20b
CASSJAVA-53 Upgrade Guava to 33.3.1-jre
Fixes [CASSJAVA-53](https://issues.apache.org/jira/browse/CASSJAVA-53).
diff --git a/core/src/test/java/com/datastax/dse/driver/internal/core/cql/reactive/TestSubscriber.java b/core/src/test/java/com/datastax/dse/driver/internal/core/cql/reactive/TestSubscriber.java index aed7a4dfc8e..b3af8c91532 100644 --- a/core/src/test/java/com/datastax/dse/driver/internal/core/cql/reactive/TestSubscri...
3
3
1
[{"id": "G0", "claim": "The switch of the `fail` static import in core TestSubscriber from AssertJ to JUnit seems unrelated to the Guava upgrade.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new `awaitTermination` code is incorrect: `Unint...
null
apache__cassandra-java-driver__2036
apache/cassandra-java-driver
2,036
defect
342e2dcf47afab238f357ac2afde65b079ce6b79
1afcf843e5604722dbe6b94c4f57acb95d542374
CASSJAVA-92: Local DC provided for nodetool clientstats
Fixes: [CASSJAVA-92](https://issues.apache.org/jira/browse/CASSJAVA-92)
diff --git a/core/src/main/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilder.java b/core/src/main/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilder.java index 684d6b01b9cc..7a9907b73f2d 100644 --- a/core/src/main/java/com/datastax/oss/driver/internal/core/context/StartupOpt...
4
3
2
[{"id": "G0", "claim": "The majority of the STARTUP-message logic in StartupOptionsBuilder should be consolidated into the lazy startup-options methods DefaultDriverContext already defines, rather than splitting that logic between the two classes.", "category": "design", "verdict": "opposed", "priority": "P2", "scope":...
null
apache__causeway__2412
apache/causeway
2,412
defect
f8728808f8b0ff7211bafb48b21ff423944b7516
7b0b7036195eb9bae420186d0e00cabdb69a01a9
Estup2-668 adding a bulk mode for the generic repository to enable delaying commits
When handling large collections it may be beneficial to delay the commit for performance reasons. This framework is a tread safe way to delay the committing. This only applies of the code is not used within transactional boundries already. As an example of use the case of audit trail entry insertions in bulk is use...
diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/publishing/log/EntityPropertyChangeLogger.java b/api/applib/src/main/java/org/apache/causeway/applib/services/publishing/log/EntityPropertyChangeLogger.java index fb0b6292c9c..365092e98d2 100644 --- a/api/applib/src/main/java/org/apache/causeway/...
8
8
7
[{"id": "G0", "claim": "The new onBulkChanging method on EntityPropertyChangeSubscriber should be declared default for backward compatibility with existing implementors.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The new createForBulk method on Audit...
null
apache__celix__143
apache/celix
143
defect
7e3c4906cedd7535e8b2e80151d80f6038fc8430
dcf5e90f214d4f24978527827c04fa162bbf3f47
Feature/pubsub websocket full duplex communication
Created a full duplex communication mechanism for the websocket pubsub by adding an endpoint for each subscriber. This creates an opportunity to connect with the subscriber with the help of a webpage. The websocket publisher example is also updated with an added subscriber and renamed to pubsub_websocket_example instea...
diff --git a/bundles/http_admin/http_admin/src/activator.c b/bundles/http_admin/http_admin/src/activator.c index b388d9972..4578ada46 100644 --- a/bundles/http_admin/http_admin/src/activator.c +++ b/bundles/http_admin/http_admin/src/activator.c @@ -54,7 +54,6 @@ static int http_admin_start(http_admin_activator_t *act, ...
3
1
0
[{"id": "G0", "claim": "Use the SUB_NAME define instead of the duplicate \"poiCmd\" literal in the SUB_TOPICS array.", "category": "maintainability", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Remove the commented-out code in pubsub_websocket_example.c (the commented poi_t ca...
null
apache__celix__159
apache/celix
159
defect
7b0a461d44c3fb41d91468ac2bb761613bbe10a0
cc390dc1c03ece4978fa39f17ef3ba3d26d6c45d
Feature/slow rsa
Fixes an issue where the curl read callback was called for byte for byte instead of large chunks. Also refactors the curl write callback, this callback is called only once with all the data presented, so no need to realloc.
diff --git a/bundles/pubsub/examples/pubsub/pubsub_websocket/private/src/pubsub_websocket_example.c b/bundles/pubsub/examples/pubsub/pubsub_websocket/private/src/pubsub_websocket_example.c index 7b820f0df..5d079d4e9 100644 --- a/bundles/pubsub/examples/pubsub/pubsub_websocket/private/src/pubsub_websocket_example.c +++ ...
2
1
0
[{"id": "G0", "claim": "The newly added <assert.h> include in remote_service_admin_dfi.c is unnecessary and should be removed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The loop in remoteServiceAdmin_readCallback could be manually unrolled ...
null
apache__celix__165
apache/celix
165
defect
78ef99c21c1a791c800a68eb7b753401b1a13fc3
f4671e0fa3a00da28bc1279a9375677b0ade2615
Feature/framework racecondition
Refactoring of service listener handling. Moved from framework to registry and made it retroactively to prevent race condition when adding a service listener and looking up already registered services.
diff --git a/bundles/device_access/example/refining_driver/CMakeLists.txt b/bundles/device_access/example/refining_driver/CMakeLists.txt index ba0469cfe..5f558281c 100644 --- a/bundles/device_access/example/refining_driver/CMakeLists.txt +++ b/bundles/device_access/example/refining_driver/CMakeLists.txt @@ -27,3 +27,5 ...
2
1
0
[{"id": "G0", "claim": "Removing serviceTracker_invokeModifiedService without a replacement leaves users with no way to be informed about service property changes.", "category": "design", "verdict": "uncertain", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "A large block of commented-out code (celix_...
null
apache__celix__181
apache/celix
181
defect
61974f2f7d1066afffcc8f16f4b40aff46ddd364
84239cd35d2110524a9157ca0a553575794ab4ec
Updated ZMQ implementation to use NULL if scope is not set. Only when…
… needed "default" is used. Added exclude filter to example for scope, to make sure that the right publisher is found. If a publisher without scope, and a publisher with a scope, use the same topic, this could result in getting the wrong publisher service. For now, only updated the ZMQ admin.
diff --git a/bundles/pubsub/examples/pubsub/publisher/private/src/ps_pub_activator.c b/bundles/pubsub/examples/pubsub/publisher/private/src/ps_pub_activator.c index d545cbcb8..c87e8e0e8 100644 --- a/bundles/pubsub/examples/pubsub/publisher/private/src/ps_pub_activator.c +++ b/bundles/pubsub/examples/pubsub/publisher/pr...
6
3
1
[{"id": "G0", "claim": "The scope-match logic in pubsub_zmqAdmin_connectEndpointToReceiver should log a warning when the endpoint does not match a receiver's scope.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "pubsub_discovery_announceEndpoint should u...
null
apache__celix__257
apache/celix
257
defect
6c5ea5ac7254d416a0bae651244012ab03a223b2
9a1c906b54c6cd38ce5820b27a432e4c20678bc2
Refactors all pubsub admins to handle multiple subscribers per bundle
Refactors all pubsub admins to support multiple subscriber services with the same topic/scope combination in a single bundle. @Oipo Could you also have a look?
diff --git a/bundles/pubsub/CMakeLists.txt b/bundles/pubsub/CMakeLists.txt index f4ac92ad9..90d762a0a 100644 --- a/bundles/pubsub/CMakeLists.txt +++ b/bundles/pubsub/CMakeLists.txt @@ -34,19 +34,11 @@ if (PUBSUB) add_subdirectory(pubsub_admin_udp_mc) endif (BUILD_PUBSUB_PSA_UDP_MC) - set(BUILD_PUBSUB...
2
1
1
[{"id": "G0", "claim": "With multiple subscribers, each invocation of the receive callback may take ownership via the release boolean, which would free a message another subscriber still needs — also applies to releaseMsg in this function.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": ...
null
apache__celix__264
apache/celix
264
defect
8e35298982eccde8767b8a1663b60fa427a1b521
7440b9a43e062070a9d0c612aa97b1778a64d4cc
Bugfix/zmq wrong sender connections
Fixes an issue where pubsub receivers where connecting to the wrong senders. This was because the publisher topic and scope where not check before connection in the setupTopicReceiver call. Also updates the handling of scopeless (NULL) and "default" scoped publisher/receiver. Scopeless and "default" scoped pub...
diff --git a/bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_admin.c b/bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_admin.c index 67d433304..e7ad284ef 100644 --- a/bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_admin.c +++ b/bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_admin.c @@ -549,7 +549,7 @@ celix_status_t pubs...
1
1
0
[{"id": "G0", "claim": "In each pubsub admin's addDiscoveredEndpoint, the topic receiver should be looked up by a scope/topic key instead of iterating over all receivers and matching, since that is still possible when topic/scope match.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introdu...
null
apache__celix__282
apache/celix
282
defect
d2defb7388ad74929070c390dd760c2f3d7680c1
921ed6e142707926b2b5edfdf83b58e749759369
Hotfix/rsa deadlock
The previous pr did not solve the deadlock issue. This PR adds a test to reproduce the deadlock and adds a "export service closing" thread to the Remote Service Admin DFI to prevent the deadlock. Not a perfect solution, but IMO fine for now. A more long term solution can be implemented when the feature/async_s...
diff --git a/bundles/remote_services/remote_service_admin_dfi/gtest/src/rsa_client_server_tests.cc b/bundles/remote_services/remote_service_admin_dfi/gtest/src/rsa_client_server_tests.cc index 9c4295126..b8ef8f05b 100644 --- a/bundles/remote_services/remote_service_admin_dfi/gtest/src/rsa_client_server_tests.cc +++ b/b...
5
3
1
[{"id": "G0", "claim": "The stop/destroy block added in remoteServiceAdmin_removeExportedService duplicates the same block in remoteServiceAdmin_stop and should be refactored into a macro or a function.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "clai...
null
apache__celix__315
apache/celix
315
defect
afdb357a6c86773acf51840021ebbac1a2618ebd
261adf891776ea2c770cfaeae938a2f26e8e35ac
Adds test and improvements for remote service calls for large payloads
Updates handling of CURL reply and civetweb write for RSA so that large payloads are supported.
diff --git a/bundles/remote_services/examples/remote_example_service/src/remote_example_impl.c b/bundles/remote_services/examples/remote_example_service/src/remote_example_impl.c index 1439e11ae..542f4c660 100644 --- a/bundles/remote_services/examples/remote_example_service/src/remote_example_impl.c +++ b/bundles/remot...
2
1
1
[{"id": "G0", "claim": "The new test only checks that result starts with 4 'A' characters and no longer verifies that the result has the expected length.", "category": "testing", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The retry loop calls mg_write(conn, response, strlen(r...
null
apache__celix__351
apache/celix
351
defect
c168eec874822b4e95c41989c3bf296f6fd0f182
3105275451813f34ab7e5dd867b9b41111e5f9a9
Refactors http_admin to use gtest and fixes a segfault issue
Refactor http_admin test to use googletest and fixes an issue where a request to the root page could lead to a segfault.
diff --git a/bundles/http_admin/CMakeLists.txt b/bundles/http_admin/CMakeLists.txt index a1dea64a3..a0c7b0dcf 100644 --- a/bundles/http_admin/CMakeLists.txt +++ b/bundles/http_admin/CMakeLists.txt @@ -23,7 +23,7 @@ if (HTTP_ADMIN) add_subdirectory(http_admin) if (ENABLE_TESTING) - add_subdirectory(te...
2
1
1
[{"id": "G0", "claim": "If uri_token is NULL the loop deadlocks because current never advances, so that case must also be caught (setting current to NULL).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The pull request should handle a request to th...
null
apache__celix__373
apache/celix
373
defect
ae90ebba936cf532d2aa99de77826aced0bfc600
a620a2e2864e6414668ffbc2b06fa09097eae65b
Updates C++ header only to C++17
This PR set the C++ standard to C++17 and updates part of the C++ headers for C++17. An exception is made for the C++ dependency manager, because the C++ dependency manager was already released in celix 2.2.1 for C++11. For the C++ dependency manager a extra test executable is made using C++11. Also: - Moves th...
diff --git a/CMakeLists.txt b/CMakeLists.txt index 88ec2f6c4..deea4e592 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ set(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -fPIC ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}") # Set C++ specific flags -set(CMAKE_CXX_STANDARD 17) #te...
8
4
2
[{"id": "G0", "claim": "The level-6 auto-start line in ContainerPackaging.cmake sets CELIX_AUTO_START_5 instead of CELIX_AUTO_START_6 for CONTAINER_BUNDLES_LEVEL_6, so level-6 bundles would be auto-started under the wrong variable.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introdu...
null
apache__celix__400
apache/celix
400
defect
ca74a957d415cea0120a549bbf75752a0bff44fd
ab49295594012f6d2f6efeea396adc9f3770f022
Improved error codes for remote services
#396 #394 This PR improves the error code for the remote service, and fixes some memory leak issues related remote service.
diff --git a/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt b/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt index f3931c74b..aa33865f8 100644 --- a/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt +++ b/bundles/remote_services/remote_service_admin_dfi/...
4
3
0
[{"id": "G0", "claim": "The existing old-style error codes (e.g. CELIX_FRAMEWORK_EXCEPTION) should be replaced with the new CELIX_ERROR_MAKE facility-based approach, and an example of that approach created.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim":...
null
apache__celix__452
apache/celix
452
defect
646e32eef2b1581175e0f117690150da37933c26
d7d6ef4a5e2d43886fbfd179f310725b0968cc75
Feature/pstm missing receiver fix
This PR should fix issue #397. I expect the issue was that the import/export components where using the suspend strategy resulting in unnecessary starting/stopping of the components. This PR also: - Add a better error handling for setting up TopicSenders and TopicReceivers in the pubsub topology manager - Rep...
diff --git a/bundles/cxx_remote_services/integration/src/TestExportImportRemoteServiceFactory.cc b/bundles/cxx_remote_services/integration/src/TestExportImportRemoteServiceFactory.cc index cc7da48aa..21a167a11 100644 --- a/bundles/cxx_remote_services/integration/src/TestExportImportRemoteServiceFactory.cc +++ b/bundles...
1
1
0
[{"id": "G0", "claim": "The import/export service dependencies should also work stably with the suspend strategy, questioning why locking was chosen.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
apache__celix__459
apache/celix
459
defect
b743919d093f8592f7a2c10d165991712873cd8b
d057ce8d11a97bba8c94a758de25eff9afaaf041
Replace sprintf usage with snprintf or asprintf
In MacOS 13 sprintf became deprecated. This PR replaces the usage of sprintf for snprintf or asprintf.
diff --git a/bundles/deployment_admin/src/deployment_admin.c b/bundles/deployment_admin/src/deployment_admin.c index 45eca1ab2..6284e764f 100644 --- a/bundles/deployment_admin/src/deployment_admin.c +++ b/bundles/deployment_admin/src/deployment_admin.c @@ -199,8 +199,10 @@ static celix_status_t deploymentAdmin_performR...
9
8
5
[{"id": "G0", "claim": "Using a VLA sized from strlen(admin->auditlogUrl)+6 without any sanity check of maxUrlLen is dangerous.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The new error log call passes admin->auditlogUrl without a %s conversion i...
null
apache__celix__472
apache/celix
472
defect
9d786d16610fce7c461005fc802e30f443202486
9ab2a9203945e36744dc92e68561a14084a68623
Feature/update GitHub actions
This PR updates the GitHub actions for CI. Changes: - The ubuntu and macOS yml files are updated and now also contain a conan-build - The options for coverity-scan is adjusted (more bundles are build) - The etcdlib and promise lib are now also build on pr and push - The ubuntu and macOS build are now also c...
diff --git a/.github/workflows/celix_etcdlib.yml b/.github/workflows/celix_etcdlib.yml index 1abc53cdd..a8a3b4153 100644 --- a/.github/workflows/celix_etcdlib.yml +++ b/.github/workflows/celix_etcdlib.yml @@ -1,21 +1,18 @@ -name: Standalone Celix etcdlib Weekly +name: Standalone Celix etcdlib on: + push: + pull_re...
8
7
1
[{"id": "G0", "claim": "The discovery_configured bundle should get RapidJSON via a CMake find module rather than the conan-created target.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The recipe need not disable libzip crypto and libcurl ssl to avoid t...
null
apache__celix__494
apache/celix
494
defect
62480b15af141854e552c652ffe5281d038b6495
cd7523054a117d5d58956272b0f723ab2d889836
Remove buffer mechanism from websocket pubsub admin, make similar to tcp admin
In the websocket pubsub admin, effectively there was a busy loop with polling for new connections/subscribers AND for receiving data. In the TCP admin, the receiving data is handled in another thread, so the polling can be done on a lower frequency. In this pull request, I've removed the buffer mechanism. Note that ...
diff --git a/bundles/pubsub/pubsub_admin_websocket/src/pubsub_psa_websocket_constants.h b/bundles/pubsub/pubsub_admin_websocket/src/pubsub_psa_websocket_constants.h index ada218b3a..fe99532d8 100644 --- a/bundles/pubsub/pubsub_admin_websocket/src/pubsub_psa_websocket_constants.h +++ b/bundles/pubsub/pubsub_admin_websoc...
3
3
1
[{"id": "G0", "claim": "The psa_websocket_recvThread is no longer needed because received data is now provided through civetweb, so it can be removed if the psa_websocketTopicReceiver_data function also checks the allConnected and allInitialized flags.", "category": "design", "verdict": "supported", "priority": "P2", "...
null