Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException getTimestamp in sqlserver dialect #511

Open
patriknw opened this issue Feb 2, 2024 · 0 comments
Open

NullPointerException getTimestamp in sqlserver dialect #511

patriknw opened this issue Feb 2, 2024 · 0 comments
Labels
bug Something isn't working sqlserver

Comments

@patriknw
Copy link
Member

patriknw commented Feb 2, 2024

getTimestamp of the db_timestamp seems to retrieve null from the driver. It's a NOT NULL column. Might be a bug in r2dbc-mssql?

Noticed when running EventsBySlicePerfSpec and R2dbcJournalPerfSpec.

[2024-02-02 07:20:25,846] [ERROR] [akka.persistence.journal.JournalPerfSpec$BenchActor] [akka://JournalSpec] [] [JournalSpec-akka.actor.default-dispatcher-5] - Persistence failure when replaying events for persistenceId [p-18]. Last known sequence number [0]
java.lang.NullPointerException: Cannot invoke "java.time.LocalDateTime.atZone(java.time.ZoneId)" because "timestamp" is null
	at akka.persistence.r2dbc.internal.codec.TimestampCodec$SqlServerTimestampCodec$.toInstant(TimestampCodec.scala:45)
	at akka.persistence.r2dbc.internal.codec.TimestampCodec$SqlServerTimestampCodec$.decode(TimestampCodec.scala:47)
	at akka.persistence.r2dbc.internal.codec.TimestampCodec$TimestampCodecRichRow.getTimestamp(TimestampCodec.scala:62)
	at akka.persistence.r2dbc.internal.postgres.PostgresQueryDao.$anonfun$eventsByPersistenceId$2(PostgresQueryDao.scala:365)
	at akka.persistence.r2dbc.internal.R2dbcExecutor$.$anonfun$selectInTx$3(R2dbcExecutor.scala:95)
	at io.r2dbc.mssql.DefaultMssqlResult.lambda$map$1(DefaultMssqlResult.java:137)
	at io.r2dbc.mssql.DefaultMssqlResult.lambda$doMap$5(DefaultMssqlResult.java:220)
	at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:179)
	at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drainRegular(FluxWindowPredicate.java:670)
	at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drain(FluxWindowPredicate.java:748)
	at reactor.core.publisher.FluxWindowPredicate$WindowFlux.subscribe(FluxWindowPredicate.java:823)
	at reactor.core.publisher.Mono.subscribe(Mono.java:4495)
	at reactor.core.publisher.Mono.subscribeWith(Mono.java:4561)
	at reactor.core.publisher.Mono.toFuture(Mono.java:5073)
	at akka.persistence.r2dbc.internal.R2dbcExecutor$PublisherOps$.asFuture$extension(R2dbcExecutor.scala:43)
	at akka.persistence.r2dbc.internal.R2dbcExecutor$.$anonfun$selectInTx$1(R2dbcExecutor.scala:97)
	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:470)
	at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:64)
	at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:101)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
	at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:101)
	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49)
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

Attached log at debug level, but also noticed without debug logging.

sqlserver-getTimestamp-null.log.zip

@patriknw patriknw added bug Something isn't working sqlserver labels Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sqlserver
Projects
None yet
Development

No branches or pull requests

1 participant