Repository navigation
Closed
Description
Test failure in System.Transactions.Tests.OleTxTests, found in https://github.com/dotnet/runtime/pull/73748/checks?check_run_id=7812731906
LOG: https://helix.dot.net/api/2019-06-17/jobs/3d6ddf47-29eb-453d-96aa-7f19f2e55bc6/workitems/System.Transactions.Local.Tests/console
System.Transactions.Tests.OleTxTests.Volatile_and_durable_enlistments(volatileCount: 0) [FAIL]
System.NullReferenceException : Object reference not set to an instance of an object.
Stack Trace:
/_/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcProxyShimFactory.cs(315,0): at System.Transactions.DtcProxyShim.DtcProxyShimFactory.GetCachedOptions()
/_/src/libraries/System.Transactions.Local/src/System/Transactions/DtcProxyShim/DtcProxyShimFactory.cs(143,0): at System.Transactions.DtcProxyShim.DtcProxyShimFactory.BeginTransaction(UInt32 timeout, OletxTransactionIsolationLevel isolationLevel, Object managedIdentifier, Guid& transactionIdentifier, TransactionShim& transactionShim)
/_/src/libraries/System.Transactions.Local/src/System/Transactions/Oletx/OletxTransactionManager.cs(448,0): at System.Transactions.Oletx.OletxTransactionManager.CreateTransaction(TransactionOptions properties)
/_/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionState.cs(2172,0): at System.Transactions.TransactionStatePromoted.EnterState(InternalTransaction tx)
/_/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionState.cs(549,0): at System.Transactions.EnlistableStates.EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
/_/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs(503,0): at System.Transactions.Transaction.EnlistDurable(Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions)
/_/src/libraries/System.Transactions.Local/tests/OleTxTests.cs(109,0): at System.Transactions.Tests.OleTxTests.Volatile_and_durable_enlistments(Int32 volatileCount)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
/_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(64,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Finished: System.Transactions.Local.Tests
=== TEST EXECUTION SUMMARY ===
System.Transactions.Local.Tests Total: 289, Errors: 0, Failed: 1, Skipped: 0, Time: 24,766s
Activity
danmoseley commentedon Aug 12, 2022
@roji
roji commentedon Aug 13, 2022
Will take a look, thanks.
roji commentedon Aug 14, 2022
@danmoseley:
Notes (mainly to self):
Safer state handling in distributed transactions
Safer state handling in distributed transactions (#73918)
jakobbotsch commentedon Aug 15, 2022
We are also seeing win-arm64 failures on this test in libraries-jitstress runs but with a different message.
Example failure: https://dev.azure.com/dnceng/public/_build/results?buildId=1942500&view=ms.vss-test-web.build-test-results-tab&runId=50062640&resultId=200894&paneView=debug
Example log: https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-7009fae360db496db1/System.Transactions.Local.Tests/1/console.08fd122e.log?helixlogtype=result
Message:
roji commentedon Aug 15, 2022
@jakobbotsch thanks. Yeah, I suspect the root cause here is the same as the NRT posted above, #73918 may eliminate the NRT itself and make the real exception propagate.
As written above, tes Volatile_and_durable_enlistments with volatileCount=0 is the very first test which communicates with MSDTC, and the stack trace shows the communication failure happening on the very first attempt to connect to it (ConnectToProxy). MSDTC has an on-demand feature, where it's disabled by default on Windows boot, and then the first call to it (DtcGetTransactionManagerEx) starts is "on demand". This call throws XACT_E_TMNOTAVAILABLE, but only on the very first connection; so I suspect that in our CI environment the MSDTC starts too slowly or similar, causing the first failure, but by the time the 2nd test runs, all is OK.
I'll work around this by using a class fixture to trigger DtcGetTransactionManagerEx multiple times, as necessary, before the first test runs. If we see users complaining about this, we can consider some sort of loop inside Sys.Tx itself.