René's URL Explorer Experiment


Title: Reading variable sized data (a small entry followed by a large entry) leads to IndexOutOfBoundsException · Issue #183 · lmdbjava/lmdbjava · GitHub

Open Graph Title: Reading variable sized data (a small entry followed by a large entry) leads to IndexOutOfBoundsException · Issue #183 · lmdbjava/lmdbjava

X Title: Reading variable sized data (a small entry followed by a large entry) leads to IndexOutOfBoundsException · Issue #183 · lmdbjava/lmdbjava

Description: This is a bit of a doozy. We're in the process of moving an application to lmdbjava. We observe that when running the tests the following occurs: If the tests are all run in the same JVM process then we consistently get very strange erro...

Open Graph Description: This is a bit of a doozy. We're in the process of moving an application to lmdbjava. We observe that when running the tests the following occurs: If the tests are all run in the same JVM process th...

X Description: This is a bit of a doozy. We're in the process of moving an application to lmdbjava. We observe that when running the tests the following occurs: If the tests are all run in the same JVM proces...

Opengraph URL: https://github.com/lmdbjava/lmdbjava/issues/183

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Reading variable sized data (a small entry followed by a large entry) leads to IndexOutOfBoundsException","articleBody":"This is a bit of a doozy.\r\n\r\nWe're in the process of moving an application to lmdbjava. We observe that when running the tests the following occurs:\r\n\r\n1. If the tests are all run in the same JVM process then we consistently get very strange errors related to ByteBuf validation constraints:\r\n\r\nFor example:\r\n\r\n```\r\nCaused by: java.lang.IndexOutOfBoundsException: readerIndex: 1297, writerIndex: 1095 (expected: 0 \u003c= readerIndex \u003c= writerIndex \u003c= capacity(1095))\r\n        at io.netty.buffer.AbstractByteBuf.checkIndexBounds(AbstractByteBuf.java:112)\r\n        at io.netty.buffer.AbstractByteBuf.writerIndex(AbstractByteBuf.java:135)\r\n        at org.lmdbjava.ByteBufProxy.out(ByteBufProxy.java:166)\r\n        at org.lmdbjava.ByteBufProxy.out(ByteBufProxy.java:41)\r\n        at org.lmdbjava.KeyVal.valOut(KeyVal.java:134)\r\n        at org.lmdbjava.Cursor.seek(Cursor.java:377)\r\n        at org.lmdbjava.Cursor.first(Cursor.java:126)\r\n        at org.lmdbjava.CursorIterable.executeCursorOp(CursorIterable.java:125)\r\n        at org.lmdbjava.CursorIterable.update(CursorIterable.java:172)\r\n        at org.lmdbjava.CursorIterable.access$100(CursorIterable.java:52)\r\n        at org.lmdbjava.CursorIterable$1.hasNext(CursorIterable.java:99)\r\n```\r\n\r\nThis occurs using the very standard code to iterate over all the keys in a table:\r\n\r\n```java\r\ntry (final CursorIterable\u003cByteBuf\u003e cursor = table.iterate(txn)) {\r\n\t\t\t\r\n\t\t\tfor (final KeyVal\u003cByteBuf\u003e kv : cursor) {\r\n\t\t\t\tfinal ByteBuf keyBuffer = kv.key();\r\n\t\t\t\tfinal ByteBuf valueBuffer = kv.val();\r\n```\r\n\r\n2. If the maven build is run using -DforkCount=1C -DreuseForks=false then all the tests run perfectly fine.  [These system properties tell maven to run each test class in its own JVM](https://www.baeldung.com/maven-junit-parallel-tests) and it eliminates all errors in the build at the expense of a much slower build.\r\n\r\nAdditionally if we run a single test using the -Dtest=$TestName syntax the test passes fine.\r\n\r\nClearly there is some erorr related to static state that is leading to inter-test dependencies. If we eliminate static state by running each Test in its own JVM all the tests pass. If we run the tests run the tests in the same JVM fails.\r\n\r\nI've tried to dig into this and get some idea of what's happening and I doi believe the problem is related to the ByteBufProxy class. There are some red flags in this class:\r\n\r\n1. This class maintains significant static state in a threadlocal BUFFERS cache. There seems to be no way to reset or clear this BUFFERS. As far I can tell the cache persists even if you call Env.close() and it might explain why we're getting ByteBufs whose readIndex is larger than their writeIndex.\r\n\r\n2. The ByteBufProxy class is also hardcoded to use PooledByteBufAllocator.DEFAULT. We've had problems in the past with multiple components (netty, netty extensions) all mucking around with PooledByteBufAllocator.DEFAULT. We tend to **avoid** using PooledByteBufAllocator.DEFAULT and instead having each component use its own explicit PooledByteBufAllocator. Unfortunately there's no way to configure ByteBufProxy to use a different ByteBufAllocator.\r\n\r\n3. The ByteBufProxy class makes several questionable assumptions. ByteBufs are allocated and not released, and no attempt is made to clear() ByteBufs returned from the pool. ","author":{"url":"https://github.com/buko","@type":"Person","name":"buko"},"datePublished":"2021-10-20T09:59:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/183/lmdbjava/issues/183"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4e5ecd87-4dc0-1bfc-bca5-94a4a0bbc29b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD0F8:271BC7:172A921:1F24323:69706A9F
html-safe-nonceace20466a88eeb141019101602fa4efb8f5ef0dac3b0a90c1b136828017d72eb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEY4OjI3MUJDNzoxNzJBOTIxOjFGMjQzMjM6Njk3MDZBOUYiLCJ2aXNpdG9yX2lkIjoiNzMyMzE2MjAwODkyMTMxOTk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbcff4c905a97eaaab8472a043c11f74505d9c431757815d13fb25b5650620db2
hovercard-subject-tagissue:1031215159
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/lmdbjava/lmdbjava/183/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f9cca98bb543dbbd9924a9f96c050f0e81a7a110cb235361bef86361c09de421/lmdbjava/lmdbjava/issues/183
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f9cca98bb543dbbd9924a9f96c050f0e81a7a110cb235361bef86361c09de421/lmdbjava/lmdbjava/issues/183
og:image:altThis is a bit of a doozy. We're in the process of moving an application to lmdbjava. We observe that when running the tests the following occurs: If the tests are all run in the same JVM process th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebuko
hostnamegithub.com
expected-hostnamegithub.com
None9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2
turbo-cache-controlno-preview
go-importgithub.com/lmdbjava/lmdbjava git https://github.com/lmdbjava/lmdbjava.git
octolytics-dimension-user_id19765602
octolytics-dimension-user_loginlmdbjava
octolytics-dimension-repository_id60480511
octolytics-dimension-repository_nwolmdbjava/lmdbjava
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id60480511
octolytics-dimension-repository_network_root_nwolmdbjava/lmdbjava
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7d6181066430cc06553c8396ca201e194ae33cb9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/lmdbjava/lmdbjava/issues/183#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flmdbjava%2Flmdbjava%2Fissues%2F183
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flmdbjava%2Flmdbjava%2Fissues%2F183
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=lmdbjava%2Flmdbjava
Reloadhttps://github.com/lmdbjava/lmdbjava/issues/183
Reloadhttps://github.com/lmdbjava/lmdbjava/issues/183
Reloadhttps://github.com/lmdbjava/lmdbjava/issues/183
lmdbjava https://github.com/lmdbjava
lmdbjavahttps://github.com/lmdbjava/lmdbjava
Notifications https://github.com/login?return_to=%2Flmdbjava%2Flmdbjava
Fork 124 https://github.com/login?return_to=%2Flmdbjava%2Flmdbjava
Star 866 https://github.com/login?return_to=%2Flmdbjava%2Flmdbjava
Code https://github.com/lmdbjava/lmdbjava
Issues 8 https://github.com/lmdbjava/lmdbjava/issues
Pull requests 1 https://github.com/lmdbjava/lmdbjava/pulls
Actions https://github.com/lmdbjava/lmdbjava/actions
Projects 0 https://github.com/lmdbjava/lmdbjava/projects
Wiki https://github.com/lmdbjava/lmdbjava/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/lmdbjava/lmdbjava/security
Please reload this pagehttps://github.com/lmdbjava/lmdbjava/issues/183
Insights https://github.com/lmdbjava/lmdbjava/pulse
Code https://github.com/lmdbjava/lmdbjava
Issues https://github.com/lmdbjava/lmdbjava/issues
Pull requests https://github.com/lmdbjava/lmdbjava/pulls
Actions https://github.com/lmdbjava/lmdbjava/actions
Projects https://github.com/lmdbjava/lmdbjava/projects
Wiki https://github.com/lmdbjava/lmdbjava/wiki
Security https://github.com/lmdbjava/lmdbjava/security
Insights https://github.com/lmdbjava/lmdbjava/pulse
New issuehttps://github.com/login?return_to=https://github.com/lmdbjava/lmdbjava/issues/183
New issuehttps://github.com/login?return_to=https://github.com/lmdbjava/lmdbjava/issues/183
Reading variable sized data (a small entry followed by a large entry) leads to IndexOutOfBoundsExceptionhttps://github.com/lmdbjava/lmdbjava/issues/183#top
https://github.com/buko
https://github.com/buko
bukohttps://github.com/buko
on Oct 20, 2021https://github.com/lmdbjava/lmdbjava/issues/183#issue-1031215159
These system properties tell maven to run each test class in its own JVMhttps://www.baeldung.com/maven-junit-parallel-tests
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.