Simplify EventKeeperTranslator so that it references pre-existing events rather than creating copies#3990
Draft
alecgrieser wants to merge 2 commits intoFoundationDB:mainfrom
Draft
Conversation
…vents rather than creating copies
ScottDugas
reviewed
Mar 4, 2026
| static { | ||
| eventKeeperMap.put(EventKeeper.Events.JNI_CALL, | ||
| new Count("JNI_CALLS", "jni calls", false)); | ||
| FDBStoreTimer.Counts.JNI_CALLS); |
Collaborator
There was a problem hiding this comment.
java.lang.UnsupportedOperationException: Programmer error: Counter(name = jni calls) is not a timer
at com.apple.foundationdb.relational.recordlayer.util.MetricRegistryStoreTimer$RegistryCounter.record(MetricRegistryStoreTimer.java:108)
at com.apple.foundationdb.record.provider.common.StoreTimer.record(StoreTimer.java:558)
at com.apple.foundationdb.record.provider.foundationdb.EventKeeperTranslator.count(EventKeeperTranslator.java:72)
at com.apple.foundationdb.EventKeeper.increment(EventKeeper.java:46)
at com.apple.foundationdb.FDBTransaction.closeInternal(FDBTransaction.java:790)
at com.apple.foundationdb.NativeObjectWrapper.close(NativeObjectWrapper.java:75)
at com.apple.foundationdb.FDBDatabase.createTransaction(FDBDatabase.java:174)
at com.apple.foundationdb.record.provider.foundationdb.FDBDatabase.createTransaction(FDBDatabase.java:784)
at com.apple.foundationdb.record.provider.foundationdb.FDBDatabase.openContext(FDBDatabase.java:449)
at com.apple.foundationdb.relational.recordlayer.RecordLayerTransactionManager.createTransaction(RecordLayerTransactionManager.java:49)
at com.apple.foundationdb.relational.server.FRL.<init>(FRL.java:105)
at com.apple.foundationdb.relational.yamltests.configs.EmbeddedConfig.beforeAll(EmbeddedConfig.java:52)
at CustomTagTest.beforeAll(CustomTagTest.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Collaborator
Author
There was a problem hiding this comment.
I think I tracked this down. The error isn't that JNI_CALLS shouldn't be a COUNT. The error is that the logic that was supposed to figure out if it was a count or not was using the wrong class/interface. Fix here: 7e6b582
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For a smattering of
EventKeeper.Events, we have correspondingStoreTimer.Eventsalready defined in the enums we use for this. There's no real reason for theEventKeeperto recreate those, I don't think, so replace those references with references to the enum values.