-
Notifications
You must be signed in to change notification settings - Fork 287
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
Namespaces changed between 2.4.0 and 2.5.0 #727
Comments
Sorry for the inconvenience. |
I thought we had the public API checker analyzer to avoid this sort of thing. Or perhaps it wasn't added until later. |
@pharring we do have a checker and I think the expectation is that this should have been caught. |
Hi, do you know any date when this will be fixed? |
Sorry for the delay, finally getting back to this... Looks like this changed happened on 2017-11-20 as a part of PR #656.
(Channel -> TelemetryChannel) This class is in the "TelemetryChannel" directory, so this change isn't incorrect... but because it's a public class it has affected some customers (see link above). @SergeyKanzhelev, would it be better to revert this change, or should we reach out to webjobs and ask them to update? Who would we contact to discuss with them? |
Do we have stable version of SDK with those classes moved already? If so - we would need to add classes into older SDK which are basically a proxies to the ones in new namespaces. If it was released in |
Based on what I found while tracking this down the change happened prior to releasing AI 2.5.0 so the webjobs team needs to update their package, release a new major or minor version with the AI dependency set to >= 2.5.0, and then do a patch release of the effected version that locks the AI version to < 2.5.0. |
@xt0rted We're going to take ownership and fix it on our end. |
@MS-TimothyMothra I just updated to 2.6.1 of app insights and with both 2.1.0 and 2.2.0 of the webjobs sdk it crashes on startup. Did the changes in #775 not make it into this release? This is my error:
|
Looks like that PR along with others merged between April 13th and May 2nd exist in the |
@xt0rted We'll do a patch release 2.6.2 to include this. Thanks for taking time to report/investigate the issue! |
@xt0rted I'm sorry this got left out of the previous release. I'm starting our release process now, and I would expect to see 2.6.2 on NuGet either Friday or Monday. |
Hi @xt0rted, I just published 2.6.2 to NuGet. If you have any issues, feel free to re-open this ticket. |
@MS-TimothyMothra, @paulbatum this update didn't fix the issue, just introduced a different error. Calling it either way results in an exception. loggerFactory.AddApplicationInsights(instrumentationKey, null);
loggerFactory.AddApplicationInsights(new DefaultTelemetryClientFactory(instrumentationKey, new SamplingPercentageEstimatorSettings(), null));
I think the only way to fix this at this point is for the webjobs sdk to bump the app insights dependency to 2.6.2 so it's compiled against the new version. I can't try wiring this up manually either because |
@xt0rted I am not sure I follow your reasoning that this needs to be fixed on the webjobs side. If a method not found error is occurring that means this release still has breaking changes and failed to follow semver. |
Hmm, I guess the other possibility is that we are getting into a state where two versions of app insights are loaded side by side and that is somehow contributing to the above error. Functions has a binding redirect for app insights that applies up to 2.4.0: |
I'm using the SDK style projects so there's no binding redirects in my Test 1
In my project I commented out the webjobs nuget references and referenced the dlls directly: <ItemGroup>
<Reference Include="Microsoft.Azure.WebJobs">
<HintPath>..\..\..\..\GitHub\azure-webjobs-sdk\src\Microsoft.Azure.WebJobs.Logging.ApplicationInsights\bin\Debug\Microsoft.Azure.WebJobs.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.WebJobs.Host">
<HintPath>..\..\..\..\GitHub\azure-webjobs-sdk\src\Microsoft.Azure.WebJobs.Logging.ApplicationInsights\bin\Debug\Microsoft.Azure.WebJobs.Host.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.WebJobs.Logging.ApplicationInsights">
<HintPath>..\..\..\..\GitHub\azure-webjobs-sdk\src\Microsoft.Azure.WebJobs.Logging.ApplicationInsights\bin\Debug\Microsoft.Azure.WebJobs.Logging.ApplicationInsights.dll</HintPath>
</Reference>
</ItemGroup> I then loaded up my webjob and it ran as expected with no crashes. Test 2I switched back to the 2.6.2 nuget packages and modified my code as follows: loggerFactory.AddApplicationInsights(
new DefaultTelemetryClientFactory(
instrumentationKey,
samplingSettings: null,
filter: null)); I then loaded up my webjob and it ran as expected with no crashes. Test 3I reverted my code back to the original setup: loggerFactory.AddApplicationInsights(instrumentationKey, null); And then added manual binding redirects to my <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.ApplicationInsights" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.2.0" newVersion="2.6.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AI.ServerTelemetryChannel" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.2.0" newVersion="2.6.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime> I then loaded up my webjob and received the same error as without the binding redirects. ResultsUsing v2.6.2 of AI you can use the AI logger, but you have to use the Here's the live metrics in the portal during tests 1 and 2. The underlying fix to 2.6.x was to re-add a SamplingPercentageEstimatorSettings class to the original namespace and inherit from the moved copy of the class. It's my understanding that this is a breaking change which requires a recompile along the lines of if you adjusted a method's parameter to be optional. On the surface it looks ok but the clr isn't going to handle dropping in a new version of the DLL it without a recompile. It's possible I'm reading all of this wrong and there's something else going on, but updating the AI reference and recompiling does fix the issue for me. Since 2.5.1 fixed a critical bug, and until now I've been unable to update to it, I'm going to try updating my webjobs to use the setup that passes null for the sampling settings. That seems to be an acceptable workaround for the time being. |
@paulbatum This is totally our fault, we should have never changed this class's namespace. Are you willing to update your reference to our 2.6.2? |
@MS-TimothyMothra Ahh I was confused, I thought 2.6.2 reverted the change, now I understand. Thanks for helping with this. Updating the reference for us is technically possible but somewhat scary because when we do this, all of our customers are automatically rolled forward and sometimes even minor updates can have subtle changes that impact applications. So we generally only do this when our hand is forced (such as a security update). Fully reverting the change is definitely more appealing from my perspective. I would recommend you consider unlisting on NuGet all the intermediate packages that contained the semver break. |
Yes, please don't upgrade to 2.6.2. After further discussion that would make this worse. |
Okay, this is the landscape we have created:
What happened: The namespace for The fix for 2.6.2 was expected to be a drop in solution, both classes could co-exist. Unfortunately we didn't plan for scenarios where two versions of the SDK could co-exist. What we are doing: We will revert all namespaces back to the state of things in 2.4. For Consideration: 2.4 and 2.5 cannot co-exist because the types (namespaces) are different. |
@paulbatum Does this plan sound good to you? @xt0rted Would you be available to test a private copy of 2.6.3 before I publish it to NuGet? |
yea, whenever it's ready just let me know |
@xt0rted Good Morning, I have the private bits ready for testing, they're on our private package feed (install command below). I recommend you do not use this package feed for your production app, we frequently post develop builds here for testing! If yours is a web project, you can just install this and it will install all dependencies.
Otherwise you'll want to install these individually
Once I hear back from you I'll continue with our release and should get these published to NuGet early next week! |
@MS-TimothyMothra I just did two tests:
Comparing the two versions of The only change in Diff of Diff of I'm going to clone this repo and play with the class a bit to see if I can get it to run without touching the webjobs sdk code. Just to confirm 2.6.3 is targeting the |
@MS-TimothyMothra I think I figured it out. The method not found exception is pointing to the That class uses the Moving just this delegate to a new file using the I didn't do an expansive test, but nothing's crashing yet. I'm also not sure if there's other classes that may need to change back to the old namespace, but this one delegate does for sure. |
@xt0rted 2.6.4 has been pushed to MyGet
If you need the Web portion, I'm prepping that now and will release before the EOD. Explaining what happened with |
@MS-TimothyMothra I'm referencing the I've only tested one webjob real quick, but there's no crashes and I'm seeing stats in the live metrics view. |
@xt0rted that is great news for a Monday! tears of joy I can't thank you enough for your help! |
@MS-TimothyMothra happy to help and glad to see it's finally resolved 🤞 The 2.6.4 packages on myget, are they the same ones that'll be going up to nuget? If so I'll update my project tomorrow with them and do a deploy. |
Answering your question: Yes, the bits on MyGet now are the same that will get published to NuGet (assuming they pass acceptance testing). Out of an abundance of caution, I ask customers to please wait until we publish to NuGet before deploying to your production environment. |
@xt0rted I just published 2.6.4 to NuGet. It should be available within an hour. :) |
Just tested all of my webjobs and there were no issues, so it's going out to production now. |
I reported this in the webjobs sdk repo (Azure/azure-webjobs-sdk#1619), but I wanted to bring it up here too. Between versions 2.4.0 and 2.5.0 the
SamplingPercentageEstimatorSettings
class, which the webjobs AI logger uses, moved to a new namespace (I'm sure there's many other classes that did as well).Because of this change if you try to use version 2.1.0 of the webjobs sdk with AI 2.5.0+ it'll compile, but crash when the AI logger starts up.
The text was updated successfully, but these errors were encountered: