[ 
https://issues.apache.org/jira/browse/CASSANDRA-21525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeremiah Jordan updated CASSANDRA-21525:
----------------------------------------
    Test and Documentation Plan: 
`ClassLoadingTestSupport`/`ClassLoadingTestNonAssignable` record whether a 
target class's static initializer ran; the regression tests assert both that an 
invalid-type load is rejected and that the target class was never initialized 
(`wasInitialized(...) == false`), plus that valid implementations still resolve.

No-init regression coverage:

- Schema/DDL entry points: `TypeParser`, SASI `IndexMode`, 
`SecondaryIndexManager`, `IndexMetadata`, `CompactionParams`, 
`CompressionParams`, `ReplicationParams`, `TriggerExecutor`, and 
`MemtableParams` (invalid `factory()` return type and invalid `FACTORY` field 
type).
- Config/JMX/CLI entry points: `AuthConfig` (all six providers), 
`CipherFactory` key_provider, `DiagnosticEventPersistence`, 
`DatabaseDescriptor` snitch, guardrails 
(`ValueGenerator`/`ValueValidator`/`GuardrailsConfigProvider`), `FBUtilities` 
`newAuditLogger`/`newSslContextFactory`/`newCryptoProvider`, `AutoRepairConfig` 
splitter.
- `ParameterizedClass`: search-package fall-through (wrong-type under an 
earlier package does not abort) and 2-arg non-initializing behavior.

Sites that route through the directly-tested shared helpers (`StorageHook`, 
`StreamHook`, `ClientState` query handler, `Tracing`, TCM `ExtensionKey`) are 
covered transitively; `CacheService` loads inside the singleton constructor and 
is not testable in isolation.
                         Status: Patch Available  (was: Open)

Patches available for 4.0-trunk at:
https://github.com/JeremiahDJordan/cassandra/tree/CASSANDRA-21525-4.0-noinit
https://github.com/JeremiahDJordan/cassandra/tree/CASSANDRA-21525-4.1-noinit
https://github.com/JeremiahDJordan/cassandra/tree/CASSANDRA-21525-5.0-noinit
https://github.com/JeremiahDJordan/cassandra/tree/CASSANDRA-21525-6.0-noinit
https://github.com/JeremiahDJordan/cassandra/tree/CASSANDRA-21525-trunk-noinit

> Class Loading Improvements
> --------------------------
>
>                 Key: CASSANDRA-21525
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21525
>             Project: Apache Cassandra
>          Issue Type: Bug
>          Components: Local/Config
>            Reporter: Jeremiah Jordan
>            Assignee: Jeremiah Jordan
>            Priority: Normal
>             Fix For: 4.0.x, 4.1.x, 5.0.x, 6.0.x
>
>
> Cassandra resolves pluggable extensions by class name from configuration, 
> schema, and tooling
> inputs (cassandra.yaml, CQL DDL, JMX, schema/TCM, system properties, CLI 
> tools). These names are
> loaded with an initializing `Class.forName(name)` and only checked against 
> the expected extension
> type afterward. That ordering initializes the named class — running its 
> static initializer and any
> side effects — before confirming it is the right type, so a mistyped or 
> invalid class name is
> initialized before it is rejected. The type should be verified before 
> initialization, so that only
> validated extension classes are initialized.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to