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

Half-written metadata #370

Open
kirillt opened this issue Jul 26, 2023 · 0 comments
Open

Half-written metadata #370

kirillt opened this issue Jul 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@kirillt
Copy link
Member

kirillt commented Jul 26, 2023

We need atomic writing for metadata and other computed values.

kotlinx.serialization.json.internal.JsonDecodingException: Cannot begin reading element, unexpected token: 10 at path: $
JSON input: 
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
	at kotlinx.serialization.json.internal.AbstractJsonLexer.fail(AbstractJsonLexer.kt:528)
	at kotlinx.serialization.json.internal.AbstractJsonLexer.fail$default(AbstractJsonLexer.kt:526)
	at kotlinx.serialization.json.internal.JsonTreeReader.read(JsonTreeReader.kt:104)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeJsonElement(StreamingJsonDecoder.kt:33)
	at kotlinx.serialization.json.JsonElementSerializer.deserialize(JsonElementSerializers.kt:51)
	at kotlinx.serialization.json.JsonElementSerializer.deserialize(JsonElementSerializers.kt:27)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:59)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:38)
	at kotlinx.serialization.json.Json.decodeFromString(Json.kt:100)
	at kotlinx.serialization.json.Json.parseToJsonElement(Json.kt:128)
	at space.taran.arklib.domain.meta.MetadataStorage.valueFromBinary(MetadataStorage.kt:35)
	at space.taran.arklib.domain.storage.FolderStorage$readFromDisk$jobs$2$1.invokeSuspend(FolderStorage.kt:94)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@8ef4f0d, Dispatchers.IO]
@kirillt kirillt added the bug Something isn't working label Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant