Skip to content

chore: Update airlift to 0.227 version#27070

Merged
NikhilCollooru merged 1 commit intoprestodb:masterfrom
NikhilCollooru:fixJsonContention
Feb 23, 2026
Merged

chore: Update airlift to 0.227 version#27070
NikhilCollooru merged 1 commit intoprestodb:masterfrom
NikhilCollooru:fixJsonContention

Conversation

@NikhilCollooru
Copy link
Copy Markdown
Contributor

@NikhilCollooru NikhilCollooru commented Feb 3, 2026

Description

Update airlift version to include json serde contention fix.

Motivation and Context

We observed InternCache lock contention during high-concurrency JSON deserialization in remote task communication. The fix is in airlift. So update the version.

Impact

Improved performance of the coordinator at higher concurrency with lesser contention

Test Plan

Unit tests and verifier testing.

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTES ==

@prestodb-ci prestodb-ci added the from:Meta PR from Meta label Feb 3, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Feb 3, 2026

Reviewer's Guide

Adds a configurable feature flag to disable Jackson’s INTERN_FIELD_NAMES during JSON deserialization and wires it into server bootstrap so high‑concurrency paths can use a custom ObjectMapper that avoids String intern cache contention, with corresponding configuration tests.

Sequence diagram for conditional ObjectMapper binding based on jsonInternFieldNamesDisabled

sequenceDiagram
    participant ConfigLoader
    participant FeaturesConfig
    participant ServerMainModule
    participant GuiceBinder as GuiceBinder
    participant PrestoJsonObjectMapperProvider
    participant JsonObjectMapperProvider
    participant ClientComponent

    ConfigLoader->>FeaturesConfig: construct with json_intern_field_names_disabled
    Note over FeaturesConfig: jsonInternFieldNamesDisabled set from config

    ServerMainModule->>FeaturesConfig: isJsonInternFieldNamesDisabled()
    FeaturesConfig-->>ServerMainModule: boolean disabled

    alt intern field names disabled
        ServerMainModule->>GuiceBinder: bind ObjectMapper to PrestoJsonObjectMapperProvider
    else intern field names enabled
        ServerMainModule->>GuiceBinder: bind ObjectMapper to JsonObjectMapperProvider
    end

    ClientComponent->>GuiceBinder: request ObjectMapper
    alt disabled
        GuiceBinder->>PrestoJsonObjectMapperProvider: get()
        PrestoJsonObjectMapperProvider-->>GuiceBinder: ObjectMapper(INTERN_FIELD_NAMES disabled)
    else enabled
        GuiceBinder->>JsonObjectMapperProvider: get()
        JsonObjectMapperProvider-->>GuiceBinder: ObjectMapper(default settings)
    end
    GuiceBinder-->>ClientComponent: ObjectMapper instance
Loading

Class diagram for new JSON intern-field-names configuration and ObjectMapper provider

classDiagram
    class FeaturesConfig {
        - boolean skipPushdownThroughExchangeForRemoteProjection
        - String remoteFunctionNamesForFixedParallelism
        - int remoteFunctionFixedParallelismTaskCount
        - boolean jsonInternFieldNamesDisabled
        + FeaturesConfig setRemoteFunctionFixedParallelismTaskCount(int remoteFunctionFixedParallelismTaskCount)
        + FeaturesConfig setJsonInternFieldNamesDisabled(boolean jsonInternFieldNamesDisabled)
        + boolean isJsonInternFieldNamesDisabled()
    }

    class ServerMainModule {
        + ListeningExecutorService createResourceManagerExecutor(ResourceManagerConfig resourceManagerConfig)
        ..ObjectMapper binding..
    }

    class ObjectMapperProvider {
        <<framework>>
        + ObjectMapperProvider()
        + ObjectMapperProvider(JsonFactory jsonFactory)
        + ObjectMapper get()
    }

    class JsonObjectMapperProvider {
        <<framework>>
        + JsonObjectMapperProvider()
        + ObjectMapper get()
    }

    class PrestoJsonObjectMapperProvider {
        + PrestoJsonObjectMapperProvider()
        + ObjectMapper get()
    }

    class JsonFactoryBuilder {
        + JsonFactoryBuilder()
        + JsonFactoryBuilder disable(Feature feature)
        + JsonFactory build()
    }

    class JsonFactory {
    }

    class ObjectMapper {
    }

    FeaturesConfig "1" <.. "*" ServerMainModule : reads
    ServerMainModule ..> ObjectMapper : binds
    ServerMainModule ..> JsonObjectMapperProvider : uses when jsonInternFieldNamesDisabled is false
    ServerMainModule ..> PrestoJsonObjectMapperProvider : uses when jsonInternFieldNamesDisabled is true

    PrestoJsonObjectMapperProvider --|> ObjectMapperProvider
    JsonObjectMapperProvider --|> ObjectMapperProvider

    PrestoJsonObjectMapperProvider ..> JsonFactoryBuilder : constructs
    JsonFactoryBuilder ..> JsonFactory : builds
    ObjectMapperProvider ..> ObjectMapper : provides
Loading

Flow diagram for json-intern-field-names-disabled configuration to runtime behavior

flowchart TD
    cfg["Configuration property json-intern-field-names-disabled"]
    fc["FeaturesConfig.jsonInternFieldNamesDisabled"]
    smm["ServerMainModule checks isJsonInternFieldNamesDisabled"]
    bindDisabled["Bind ObjectMapper to PrestoJsonObjectMapperProvider"]
    bindEnabled["Bind ObjectMapper to JsonObjectMapperProvider"]
    omDisabled["ObjectMapper created with INTERN_FIELD_NAMES disabled"]
    omEnabled["ObjectMapper created with default INTERN_FIELD_NAMES"]

    cfg --> fc
    fc --> smm

    smm -->|true| bindDisabled
    smm -->|false| bindEnabled

    bindDisabled --> omDisabled
    bindEnabled --> omEnabled
Loading

File-Level Changes

Change Details Files
Add a new feature flag to control whether JSON field-name interning is disabled.
  • Introduce jsonInternFieldNamesDisabled boolean field to FeaturesConfig with getter and @Config-mapped setter for json-intern-field-names-disabled property.
  • Set the default value of jsonInternFieldNamesDisabled in the FeaturesConfig defaults test.
  • Extend explicit property mapping tests to cover the new json-intern-field-names-disabled configuration property.
presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/FeaturesConfig.java
presto-main-base/src/test/java/com/facebook/presto/sql/analyzer/TestFeaturesConfig.java
Wire the feature flag into server bootstrap to select an appropriate ObjectMapper provider.
  • Change ServerMainModule to bind ObjectMapper to PrestoJsonObjectMapperProvider when jsonInternFieldNamesDisabled is true, otherwise keep using JsonObjectMapperProvider.
  • Ensure conditional binding occurs alongside existing HandleJsonModule installation without altering other server bindings.
presto-main/src/main/java/com/facebook/presto/server/ServerMainModule.java
Introduce a custom ObjectMapper provider that disables Jackson INTERN_FIELD_NAMES to avoid InternCache lock contention.
  • Create PrestoJsonObjectMapperProvider extending ObjectMapperProvider and constructing it with a JsonFactory built with INTERN_FIELD_NAMES disabled via JsonFactoryBuilder.
  • Document the motivation and behavior in class-level Javadoc, referencing Jackson’s InternCache contention and relevant upstream issue.
presto-main/src/main/java/com/facebook/presto/server/PrestoJsonObjectMapperProvider.java

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider adding a @ConfigDescription to setJsonInternFieldNamesDisabled to make the behavior and intended usage of the new configuration property clearer alongside the other feature flags.
  • Instead of introducing a separate PrestoJsonObjectMapperProvider, consider extending/configuring the existing JsonObjectMapperProvider to take a flag or factory customization so that ObjectMapper construction remains centralized and easier to evolve.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a `@ConfigDescription` to `setJsonInternFieldNamesDisabled` to make the behavior and intended usage of the new configuration property clearer alongside the other feature flags.
- Instead of introducing a separate `PrestoJsonObjectMapperProvider`, consider extending/configuring the existing `JsonObjectMapperProvider` to take a flag or factory customization so that ObjectMapper construction remains centralized and easier to evolve.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@NikhilCollooru NikhilCollooru changed the title Add support for disabling intern-field-names during Json parsing feat: Add support for disabling intern-field-names during Json parsing Feb 3, 2026
arhimondr
arhimondr previously approved these changes Feb 3, 2026
@steveburnett
Copy link
Copy Markdown
Contributor

Do we need documentation anywhere for this config?

@NikhilCollooru NikhilCollooru changed the title feat: Add support for disabling intern-field-names during Json parsing chore: Update airlift to 0.266 version Feb 6, 2026
@NikhilCollooru
Copy link
Copy Markdown
Contributor Author

looks like the unit test failures are related to prestodb/airlift#126 in airlift.

presto-master-1  |   File "/docker/volumes/presto-server/bin/launcher.py", line 25
presto-master-1  |     raise Exception(f"Expected file '{f}' to be 'launcher.py' not '{basename(f)}'")
presto-master-1  |                                                                                  ^
presto-master-1  | SyntaxError: invalid syntax

The error in unit tests indicates that the script is using a Python f-string (introduced in Python 3.6), but the interpreter running the script is an older version of Python (likely Python 2.x or <3.6). So we need to ensure that the Docker container is running Python 3.6 or newer.
@tdcmeehan do you know how to make sure we use python3 for the docker containers ?

@dnskr
Copy link
Copy Markdown
Contributor

dnskr commented Feb 9, 2026

@NikhilCollooru I ran the failing tests locally and found they use prestodb/centos7-oj8:11 image, see here.

The image prestodb/centos7-oj8:11 uses Python 2.7.5, which is why the tests are failing:

docker run prestodb/centos7-oj8:11 python --version                     
Python 2.7.5

Meanwhile, the latest Presto release (0.296) uses Python 3.9.25:

docker run -it --entrypoint=/bin/bash prestodb/presto:0.296
> python --version
  Python 3.9.25

@NikhilCollooru
Copy link
Copy Markdown
Contributor Author

@tdcmeehan do we have any image that uses python3 ? any suggestions on how to workaround this ?

@tdcmeehan
Copy link
Copy Markdown
Contributor

Can we just update our launcher script to use python3, instead of using the python alias?

@NikhilCollooru
Copy link
Copy Markdown
Contributor Author

Can we just update our launcher script to use python3, instead of using the python alias?

can you please point to the launcher script ...which can be modified to use python3 ?

@dnskr
Copy link
Copy Markdown
Contributor

dnskr commented Feb 9, 2026

Can we just update our launcher script to use python3, instead of using the python alias?

I’m afraid that prestodb/centos7-oj8:11 image doesn't have Python 3 at all.

@NikhilCollooru
Copy link
Copy Markdown
Contributor Author

@tdcmeehan any suggestions ?

@tdcmeehan
Copy link
Copy Markdown
Contributor

My suggestion is to update the launcher script (same file as @dnskr updated), update it to explicitly use Python 3, then enlist @unidevel to create a new image that incorporates the fix.

@NikhilCollooru
Copy link
Copy Markdown
Contributor Author

prestodb/airlift#144
to make the launcher use Python3

@NikhilCollooru NikhilCollooru changed the title chore: Update airlift to 0.266 version chore: Update airlift to 0.227 version Feb 14, 2026
@NikhilCollooru NikhilCollooru force-pushed the fixJsonContention branch 3 times, most recently from 5f030fb to 551b3b5 Compare February 19, 2026 18:48
@NikhilCollooru NikhilCollooru force-pushed the fixJsonContention branch 2 times, most recently from 56254e1 to f86150d Compare February 20, 2026 18:51
@NikhilCollooru NikhilCollooru merged commit 920353f into prestodb:master Feb 23, 2026
79 checks passed
shangm2 pushed a commit that referenced this pull request Feb 24, 2026
## Description
Update airlift version to include json serde contention fix.

## Motivation and Context
We observed InternCache lock contention during high-concurrency JSON
deserialization in remote task communication. The fix is in airlift. So
update the version.

## Impact
Improved performance of the coordinator at higher concurrency with
lesser contention

## Test Plan
Unit tests and verifier testing.

## Contributor checklist

- [x] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [x] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [x] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [x] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [x] Adequate tests were added if applicable.
- [x] CI passed.
- [x] If adding new dependencies, verified they have an [OpenSSF
Scorecard](https://securityscorecards.dev/#the-checks) score of 5.0 or
higher (or obtained explicit TSC approval for lower scores).

## Release Notes
Please follow [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines)
and fill in the release notes below.

```
== NO RELEASE NOTES ==
```
shangm2 pushed a commit that referenced this pull request Feb 24, 2026
## Description
Update airlift version to include json serde contention fix.

## Motivation and Context
We observed InternCache lock contention during high-concurrency JSON
deserialization in remote task communication. The fix is in airlift. So
update the version.

## Impact
Improved performance of the coordinator at higher concurrency with
lesser contention

## Test Plan
Unit tests and verifier testing.

## Contributor checklist

- [x] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [x] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [x] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [x] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [x] Adequate tests were added if applicable.
- [x] CI passed.
- [x] If adding new dependencies, verified they have an [OpenSSF
Scorecard](https://securityscorecards.dev/#the-checks) score of 5.0 or
higher (or obtained explicit TSC approval for lower scores).

## Release Notes
Please follow [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines)
and fill in the release notes below.

```
== NO RELEASE NOTES ==
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:Meta PR from Meta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants