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

[fix][sec] Add a check for the input time value #22023

Merged
merged 4 commits into from
Feb 26, 2024

Conversation

liangyepianzhou
Copy link
Contributor

@liangyepianzhou liangyepianzhou commented Feb 5, 2024

Motivation

The time value should not be a negative value. We need to add a check when get a time value input.

Modifications

Add a check when get a time value input.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 5, 2024
@liangyepianzhou liangyepianzhou changed the title [fix][conf] Add a check for the input time value [fix][sec] Add a check for the input time value Feb 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 3.84615% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 73.55%. Comparing base (825e997) to head (fdc14dd).
Report is 15 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22023      +/-   ##
============================================
- Coverage     73.57%   73.55%   -0.02%     
- Complexity    32575    32627      +52     
============================================
  Files          1874     1877       +3     
  Lines        139252   139527     +275     
  Branches      15260    15306      +46     
============================================
+ Hits         102454   102632     +178     
- Misses        28880    28933      +53     
- Partials       7918     7962      +44     
Flag Coverage Δ
inttests 24.58% <3.84%> (-0.20%) ⬇️
systests 24.19% <3.84%> (-0.16%) ⬇️
unittests 72.83% <3.84%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...er/mledger/impl/ManagedLedgerFactoryMBeanImpl.java 97.61% <0.00%> (-2.39%) ⬇️
...ookkeeper/mledger/impl/ManagedLedgerMBeanImpl.java 89.05% <0.00%> (-0.66%) ⬇️
...org/apache/pulsar/broker/stats/DimensionStats.java 85.71% <0.00%> (-1.56%) ⬇️
...ker/stats/prometheus/metrics/LongAdderCounter.java 0.00% <0.00%> (ø)
...pulsar/client/admin/internal/TransactionsImpl.java 91.30% <0.00%> (-1.01%) ⬇️
...apache/pulsar/client/impl/AutoClusterFailover.java 64.28% <0.00%> (-0.36%) ⬇️
...apache/pulsar/client/impl/ConsumerBuilderImpl.java 86.54% <0.00%> (-0.39%) ⬇️
.../pulsar/client/impl/ControlledClusterFailover.java 64.42% <0.00%> (-0.63%) ⬇️
...g/apache/pulsar/client/impl/ReaderBuilderImpl.java 84.21% <0.00%> (-0.90%) ⬇️
...ulsar/client/impl/TransactionMetaStoreHandler.java 67.74% <0.00%> (-0.16%) ⬇️
... and 7 more

... and 108 files with indirect coverage changes

@dao-jun dao-jun merged commit 31ed115 into apache:master Feb 26, 2024
50 checks passed
@dao-jun
Copy link
Member

dao-jun commented Feb 26, 2024

plz add release labels

heesung-sn pushed a commit that referenced this pull request Feb 27, 2024
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 1, 2024
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 6, 2024
@lhotari
Copy link
Member

lhotari commented Mar 11, 2024

This breaks Flink SQL Connector due to the usage of -1 as the default in https://github.com/apache/flink-connector-pulsar/blob/5889eb21d13126f0b4e616cabb6f07365188215e/flink-connector-pulsar/src/main/java/org/apache/flink/connector/pulsar/common/config/PulsarOptions.java#L136.
@liangyepianzhou Please make changes to allow -1 as a special value to handle that case. /cc @david-streamlio

I added #22242 to track this regression.

liangyepianzhou added a commit that referenced this pull request Mar 11, 2024
liangyepianzhou added a commit to liangyepianzhou/pulsar that referenced this pull request Mar 11, 2024
liangyepianzhou added a commit to liangyepianzhou/pulsar that referenced this pull request Mar 11, 2024
lhotari pushed a commit that referenced this pull request Mar 13, 2024
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 3, 2024
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants