Skip to content

STAR-847 Close client to prevent driver queries after dropping user#227

Merged
djatnieks merged 1 commit intods-trunkfrom
STAR-847
Jul 29, 2021
Merged

STAR-847 Close client to prevent driver queries after dropping user#227
djatnieks merged 1 commit intods-trunkfrom
STAR-847

Conversation

@djatnieks
Copy link
Copy Markdown
Member

STAR-847 guardrail unit tests sometimes fail with User guardrail_user has no SELECT permission on <table cql_test_keyspace.table_01> or any of its parents

The GuardrailTester. afterGuardrailTest method drops the test user after each test, however the java driver cluster/session remains open. If the timing is right, the driver control connection will issue queries as the test user after the user has been dropped, and this can result in an empty entry in the Roles cache. If that entry does not expire before the next test starts and the test user is created again, the empty entry will result in no permissions being recognized for the user.

A previous attempt to fix the issue - issuing a LIST ROLES query and waiting for results - didn't actually go through the Roles cache, so wasn't effective and is removed here.

This fix closes the driver cluster/session belonging to the test user when the test user is dropped, preventing bad entries from getting into the Roles cache.

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@djatnieks djatnieks merged commit 0969332 into ds-trunk Jul 29, 2021
@djatnieks djatnieks deleted the STAR-847 branch July 29, 2021 02:57
jacek-lewandowski pushed a commit that referenced this pull request Aug 25, 2021
jacek-lewandowski pushed a commit that referenced this pull request Aug 31, 2021
jacek-lewandowski pushed a commit that referenced this pull request Mar 8, 2022
jacek-lewandowski pushed a commit that referenced this pull request Mar 9, 2022
jacek-lewandowski pushed a commit that referenced this pull request Mar 30, 2022
jacek-lewandowski pushed a commit that referenced this pull request Mar 30, 2022
jacek-lewandowski pushed a commit that referenced this pull request Apr 19, 2022
jacek-lewandowski pushed a commit that referenced this pull request May 26, 2022
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
jacek-lewandowski pushed a commit that referenced this pull request Oct 17, 2022
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
jacek-lewandowski pushed a commit that referenced this pull request Oct 18, 2022
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
mfleming pushed a commit that referenced this pull request Jul 10, 2023
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
djatnieks added a commit that referenced this pull request Jul 24, 2023
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
djatnieks added a commit that referenced this pull request Aug 21, 2023
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
djatnieks added a commit that referenced this pull request Sep 12, 2023
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
djatnieks added a commit that referenced this pull request Jan 16, 2024
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java
djatnieks added a commit that referenced this pull request Mar 29, 2024
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java
djatnieks added a commit that referenced this pull request Apr 1, 2024
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java
djatnieks added a commit that referenced this pull request Apr 16, 2024
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java
djatnieks added a commit that referenced this pull request Jan 30, 2025
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java
djatnieks added a commit that referenced this pull request May 18, 2025
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java
michaelsembwever pushed a commit that referenced this pull request Feb 6, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java
michaelsembwever pushed a commit that referenced this pull request Feb 10, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Feb 11, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Feb 12, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Feb 14, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Feb 16, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Feb 27, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Mar 2, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Mar 4, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Mar 25, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Mar 27, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
michaelsembwever pushed a commit that referenced this pull request Apr 14, 2026
…227)

(cherry picked from commit 0969332)
(cherry picked from commit 91a753d)
(cherry picked from commit 56a9b56)
(cherry picked from commit a2c6bb4)
(cherry picked from commit 1bd3f63)
(cherry picked from commit 0449b6c)
(cherry picked from commit 217089a)

# Conflicts:
#	test/unit/org/apache/cassandra/cql3/CQLTester.java
#	test/unit/org/apache/cassandra/guardrails/GuardrailTester.java

 (Rebase of commit eb00759)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants