Skip to content

[pulsar-client-cpp] Fix for crash in Producer destructor#6278

Closed
heronr wants to merge 1 commit intoapache:masterfrom
heronr:ShutdownCrashFix
Closed

[pulsar-client-cpp] Fix for crash in Producer destructor#6278
heronr wants to merge 1 commit intoapache:masterfrom
heronr:ShutdownCrashFix

Conversation

@heronr
Copy link
Contributor

@heronr heronr commented Feb 9, 2020

Motivation

This change fixes a crash I encountered when the destructor of the Producer is called.

Modifications

The ProducerStatsBasePtr is now declared in the header after the ExecutorServicePtr to ensure that it is destroyed before the ExecutorService. This is because the destructor of ProducerStatsImpl will attempt to cancel its outstanding DeadlineTimer which will then dereference the now destroyed ExecutorService and cause an exception.

Verifying this change

  • Make sure that the change passes the CI checks.

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

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

  • Dependencies (does it add or upgrade a dependency): no
  • The public API: no
  • The schema: no
  • The default values of configurations: no
  • The wire protocol: no
  • The rest endpoints: no
  • The admin cli options: no
  • Anything that affects deployment: no

Documentation

  • Does this pull request introduce a new feature? no

@merlimat
Copy link
Contributor

merlimat commented Feb 9, 2020

I think this should already have been fixed in #6226. Can you double check?

@heronr
Copy link
Contributor Author

heronr commented Feb 10, 2020

Yes, you are right. That change will also result in fixing the crash I found. I'll close out this PR.

@heronr heronr closed this Feb 10, 2020
@heronr heronr deleted the ShutdownCrashFix branch February 10, 2020 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments