Skip to content

Conversation

@rob05c
Copy link
Member

@rob05c rob05c commented May 16, 2022

Tech-debt: makes it impossible to call Init multiple times and produce a malformed object, by putting it in the constructor.

What I said in #8831 was wrong: there was no technical reason the code in Init couldn't be in the constructor.

Also incidentally fixes a bug in core strategies, where a failure in a consistent_hash strategy was resetting the smart pointer on the local variable instead of the persistent member variable.

@rob05c rob05c added the Plugins label May 16, 2022
@rob05c rob05c added this to the 10.0.0 milestone May 16, 2022
@rob05c rob05c requested a review from ywkaras May 16, 2022 21:35
@rob05c rob05c self-assigned this May 16, 2022
@rob05c rob05c force-pushed the change-parent-select-init-to-constructor branch from 8f3aa9e to 05752b6 Compare May 16, 2022 21:49
Tech-debt: makes it impossible to call Init multiple times
and produce a malformed object.
@rob05c rob05c force-pushed the change-parent-select-init-to-constructor branch from 05752b6 to c1a75e0 Compare May 16, 2022 21:50
: PLNextHopSelectionStrategy(name, n)
{
TSDebug("pparent_select", "PLNextHopConsistentHash Init calling.");
TSDebug("pparent_select", "PLNextHopConsistentHash constructor calling.");
Copy link
Contributor

Choose a reason for hiding this comment

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

No issue, but while you are here, you have the PLUGIN_NAME defined up above.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. But since it'd make this require a re-review, easier to do in a separate PR

@rob05c rob05c merged commit aeb3263 into apache:master May 23, 2022
zwoop pushed a commit that referenced this pull request Jun 7, 2022
Tech-debt: makes it impossible to call Init multiple times
and produce a malformed object.

(cherry picked from commit aeb3263)
@zwoop
Copy link
Contributor

zwoop commented Jun 7, 2022

Cherry-picked to v9.2.x

@zwoop zwoop modified the milestones: 10.0.0, 9.2.0 Jun 7, 2022
masaori335 pushed a commit to masaori335/trafficserver that referenced this pull request Feb 21, 2023
* asf/9.2.x:
  Updated ChangeLog
  Add proxy.process.hostdb.total_serve_stale (apache#8873)
  Allow for long Http* error.log lines (apache#8855)
  mkdfa.c is not being used and doesn't compile with gcc 12.1.1 (apache#8838)
  Add compatibility define when building with OpenSSL3 (apache#8837)
  Make post-early-return Au test more robust. (apache#8832)
  Add support for caching complete responses to the cache range requests plugin (apache#8816)
  Fixes issues with the CRR plugin introduced in apache#8488 (apache#8828)
  slice and cache_range_requests: allow header override (apache#8666) (apache#8898)
  Removed references to the throttle option from the slice plugin. (apache#8373) (apache#8897)
  cache_range_requests plugin: don't require 206 Partial Content reason string (apache#8488)
  Improve option processing in cache promote (apache#8501)
  Change parent_select Init func to constructor (apache#8853)
  Fix "is is" typos. (apache#8866)
  Eliminate duplicate words. (apache#8870)
  money_trace: allow custom header, change span-id gen, opt to create if none (apache#8655)
  Update HostDBContinuation timeout handling to clear pending queue. (apache#8480)
  Upgrade to Proxy Verifier 2.4.0. (apache#8884)
  Change ats_scoped_obj to std::unique_ptr . (apache#8882)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants