Skip to content
This repository has been archived by the owner on Jul 5, 2020. It is now read-only.

add separate fetchers for rollback and commit message data #792

Merged
merged 4 commits into from
Jan 19, 2018

Conversation

TimothyMothra
Copy link
Member

@TimothyMothra TimothyMothra commented Jan 17, 2018

Fix issue #782 .

Short description of the fix:
SqlClient is including a TransactionName property in transaction rollback messages (but not in transaction commit messages). Added a separate “fetchers” for the rollback message data.

  • I ran all unit tests locally
  • CHANGELOG.md updated

@anpete
Copy link
Contributor

anpete commented Jan 17, 2018

I think you need to handle the transaction After and Error cases, too. Add TransactionName to the message in this unit test: https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/develop/Src/DependencyCollector/Shared.Tests/Implementation/SqlClientDiagnosticSourceListenerTests.cs#L508

@anpete
Copy link
Contributor

anpete commented Jan 17, 2018

Consider adding a unit test for the Rollback error case.

@Dmitry-Matveev
Copy link
Member

@anpete, I looked and After and Error fetchers, they seem to only care about the subset of the available fields anyway - do you expect them to fail as well if there no 1:1 match? @MS-TimothyMothra can expand this PR to modify fetchers for those as well and add them into the separate blocks within switch if required - I would just like to confirm with you if it is.

@anpete
Copy link
Contributor

anpete commented Jan 18, 2018

@Dmitry-Matveev IIRC the key thing is that a fetcher may never be used with more than one incoming message type (anonymous object shape). We need to have unit test coverage for all of the events we handle, and in those tests we should be careful to construct exact replicas of the actual SQL Client message payloads.

@TimothyMothra
Copy link
Member Author

I'm marking this PR as resolved and will confirm that we have unit tests for every possible type in a follow up issue: #796

@TimothyMothra TimothyMothra merged commit 47d1869 into develop Jan 19, 2018
@TimothyMothra TimothyMothra deleted the tilee/782_sql_dependency_rollback_transaction branch January 19, 2018 19:51
TimothyMothra added a commit that referenced this pull request Feb 1, 2018
* add separate fetchers for rollback and commit message data
* added TransactionName to unit test for rollback
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants