Skip to content

Drop unused members of DefaultAccessLogReceiver#48449

Closed
Pankraz76 wants to merge 1 commit into
quarkusio:mainfrom
Pankraz76:48342-obsolete-light
Closed

Drop unused members of DefaultAccessLogReceiver#48449
Pankraz76 wants to merge 1 commit into
quarkusio:mainfrom
Pankraz76:48342-obsolete-light

Conversation

@Pankraz76

@Pankraz76 Pankraz76 commented Jun 18, 2025

Copy link
Copy Markdown
100% (1/1) 88% (8/9) 76% (70/92) 53% (33/62)
100% (1/1) 80% (8/10) 81% (70/86) 58% (33/56)
100% (1/1) 100% (10/10) 97% (76/78) 72% (36/50)
100% (1/1) 100% (11/11) 98% (67/68) 68% (26/38)

@quarkus-bot

quarkus-bot Bot commented Jun 18, 2025

Copy link
Copy Markdown

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should not contain an issue number (use Fix #1234 in the description instead)
  • description should not be empty, describe your intent or provide links to the issues this PR is fixing (using Fixes #NNNNN) or changelogs

This message is automatically generated by a bot.

@Pankraz76
Pankraz76 marked this pull request as ready for review June 18, 2025 09:51
@geoand geoand changed the title Issue #48342 chore: drop obsoletes in DefaultAccessLogReceiver Drop unused members of DefaultAccessLogReceiver Jun 18, 2025
@Pankraz76

Pankraz76 commented Jun 18, 2025

Copy link
Copy Markdown
Author

thanks for consider and correction.

boolean created = !Files.exists(defaultLogFile);
writer = Files.newBufferedWriter(defaultLogFile, StandardCharsets.UTF_8, StandardOpenOption.APPEND,
StandardOpenOption.CREATE);
if (Files.size(defaultLogFile) == 0 && fileHeaderGenerator != null) {

@Pankraz76 Pankraz76 Jun 18, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems never been executed, as its always null.

image

@Pankraz76
Pankraz76 marked this pull request as draft June 18, 2025 12:22
@Pankraz76

Copy link
Copy Markdown
Author

need to add tests.

@Pankraz76
Pankraz76 marked this pull request as ready for review June 18, 2025 12:48
@Pankraz76

Copy link
Copy Markdown
Author

item:

2025-06-18 13:32:19,106 WARN  [org.hib.too.sch.int.ExceptionHandlerLoggedImpl] (JPA Startup Thread) GenerationTarget encountered exception accepting command : Error executing DDL "drop table OracleHit cascade constraints" via JDBC [ORA-00942: table or view "SYSTEM"."ORACLEHIT" does not exist

https://docs.oracle.com/error-help/db/ora-00942/]: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "drop table OracleHit cascade constraints" via JDBC [ORA-00942: table or view "SYSTEM"."ORACLEHIT" does not exist

https://docs.oracle.com/error-help/db/ora-00942/]
	at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:93)
	at org.hibernate.tool.schema.internal.Helper.applySqlString(Helper.java:221)
	at org.hibernate.tool.schema.internal.Helper.applySqlStrings(Helper.java:207)
	at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropTables(SchemaDropperImpl.java:383)
	at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropConstraintsTablesSequences(SchemaDropperImpl.java:255)
	at org.hibernate.tool.schema.internal.SchemaDropperImpl.dropFromMetadata(SchemaDropperImpl.java:217)
	at org.hibernate.tool.schema.internal.SchemaDropperImpl.performDrop(SchemaDropperImpl.java:185)
	at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:155)
	at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:115)
	at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:225)
	at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.lambda$process$5(SchemaManagementToolCoordinator.java:142)
	at java.base@21.0.7/java.util.HashMap.forEach(HashMap.java:1429)
	at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:139)
	at io.quarkus.hibernate.orm.runtime.observers.SessionFactoryObserverForSchemaExport.sessionFactoryCreated(SessionFactoryObserverForSchemaExport.java:21)
	at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:33)
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:350)
	at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:92)
	at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:73)
	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:90)
	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:66)
	at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:163)
	at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:63)
	at java.base@21.0.7/java.lang.Thread.runWith(Thread.java:1596)
	at java.base@21.0.7/java.lang.Thread.run(Thread.java:1583)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:896)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:872)
Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view "SYSTEM"."ORACLEHIT" does not exist

https://docs.oracle.com/error-help/db/ora-00942/
	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:712)
	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:612)
	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1364)
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:969)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:237)
	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:516)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:191)
	at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1400)
	at oracle.jdbc.driver.OracleStatement.executeSQLStatement(OracleStatement.java:2009)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1622)
	at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:[2687](https://github.com/quarkusio/quarkus/actions/runs/15733256802/job/44340596683?pr=48449#step:19:2688))
	at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:2636)
	at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:337)
	at io.agroal.pool.wrapper.StatementWrapper.execute(StatementWrapper.java:220)
	at io.opentelemetry.instrumentation.jdbc.internal.OpenTelemetryStatement.lambda$execute$5(OpenTelemetryStatement.java:96)
	at io.opentelemetry.instrumentation.jdbc.internal.OpenTelemetryStatement.wrapCall(OpenTelemetryStatement.java:304)
	at io.opentelemetry.instrumentation.jdbc.internal.OpenTelemetryStatement.execute(OpenTelemetryStatement.java:96)
	at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:79)
	... 25 more
Caused by: Error : 942, Position : 11, SQL = drop table OracleHit cascade constraints, Original SQL = drop table OracleHit cascade constraints, Error Message = ORA-00942: table or view "SYSTEM"."ORACLEHIT" does not exist

	at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:720)
	... 42 more
	

@Pankraz76

Pankraz76 commented Jun 18, 2025

Copy link
Copy Markdown
Author

let me know if rebase desired.

logWriteExecutor.execute(this);
private Path rotateLogFile(Path newFile, int count) {
if (Files.exists(newFile)) {
return rotateLogFile(outputDirectory.resolve(logBaseName + currentDateString + "-" + count + logNameSuffix), ++count);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return rotateLogFile(outputDirectory.resolve(logBaseName + currentDateString + "-" + count + logNameSuffix), ++count);
return rotateLogFile(outputDirectory.resolve(logBaseName + currentDateString + "-" + ++count + logNameSuffix), count);

wrong need test for rotation as well.

@Pankraz76
Pankraz76 marked this pull request as draft June 18, 2025 14:31
@Pankraz76
Pankraz76 marked this pull request as ready for review June 18, 2025 14:54
@Pankraz76

Copy link
Copy Markdown
Author

100% and found our bug so could merge and the fix bug.

logWriteExecutor.execute(this);
private Path rotateLogFile(Path newFile, int count) {
if (Files.exists(newFile)) {
return rotateLogFile(outputDirectory.resolve(logBaseName + currentDateString + "-" + count++ + logNameSuffix),

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having test for double and minus

image

but not for missing

image

and pre and before difference: ++count count++

@quarkus-bot

This comment has been minimized.

@Pankraz76 Pankraz76 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pankraz76 Pankraz76 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why final writer now when writing on different files?

@Pankraz76 Pankraz76 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialRun seems obsolete. therefore the block, as well.

@Pankraz76

Copy link
Copy Markdown
Author

closing as impossible for me to fix without removal of technical depth prior. Affected class has 50% dead code-

@Pankraz76

Copy link
Copy Markdown
Author

@iddeepak consider this a real benefit and learning experience in all manners.

Feel free to take over and improve quarkus, as the world relies on this high performing AC.

@Pankraz76 Pankraz76 mentioned this pull request Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant