Aggregating Timeouts In Distributed Transactions

By dynamically setting the transaction coordinator's time-to-live value to be less than participant services', the solution ensures consistent transaction outcomes by preventing resource manager timeouts in distributed transactions.

US20260377227A1Pending Publication Date: 2026-11-26ORACLE INT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
US19/213892
Authority / Receiving Office
US · United States
Patent Type
Applications(United States)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

In distributed transactions, configuring the correct time-to-live values for transaction coordinators and resource managers is complicated, leading to heuristic outcomes where the transaction coordinator continues despite resource managers timing out, resulting in inconsistent transaction states.

Method used

The transaction coordinator dynamically sets its time-to-live value to be less than the time-to-live values of all participant services, ensuring it times out before any resource manager, by communicating these values during enlistment.

Benefits of technology

This approach minimizes heuristic outcomes by ensuring the transaction coordinator times out before any resource manager, maintaining consistent transaction states across services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US20260377227A1-D00000_ABST
    Figure US20260377227A1-D00000_ABST
Patent Text Reader

Abstract

A mechanism is provided to attempt to minimize heuristic outcomes of distributed transactions. Each participant service in a distributed transaction is configured to communicate the time-to-live value of its resource manager to the transaction coordinator when enlisting in the distributed transaction. The transaction coordinator dynamically sets its time-to-live value to be less than the time-to-live values of all the participant services. This ensures that the transaction coordinator will timeout the distributed transaction before any enlisted resource managers timeout.
Need to check novelty before this filing date? Find Prior Art

Description

FIELD OF THE INVENTION

[0001] The present invention relates to performing transactions using services and resource managers and, more particularly, to configuring a time-to-live value of a transaction coordinator to improve confidence in transaction outcomes.BACKGROUND

[0002] Modern applications are built by composing multiple services that are independently developed. A service is an architectural approach to software development that breaks large applications into smaller, independent services that communicate through application programming interfaces (APIs). Each service has its own responsibility and can communicate with other parts through simple interfaces. This provides agility and speed to market for fixing issues and introducing new features. This paradigm is often referred to as a microservices architecture, although the number of services that come together for a complete application can be in the hundreds (microservices), or in the tens (macroservices). As used herein, the term “service” may refer to a microservice or a macroservice. In a microservices architecture, each service owns a simple task and communicates with clients or other services using communication mechanisms such as representational state transfer (REST) APIs.

[0003] Each service may communicate with one or more resource managers to perform operations. A resource manager is a managed service that automates deployment and operations for a resource, such as a database. The services are typically developed and deployed independently, each with its own resource managers. When a business transaction spans multiple services, it is likely necessary that some mechanism is in place to ensure that updates in these services occur atomically, i.e., either all updates occur or none of them occur. A transaction coordinator, also referred to as a transaction manager, simplifies application development and operations by enabling distributed transactions to ensure consistency across services and resource managers.

[0004] A two-phase commit is a technique used to ensure the integrity of a committing transaction. To understand how this algorithm works, consider the following sample scenario. A group of six friends wants to rent a house for a one-week vacation. No member of the group can afford to pay more than one-sixth of the rent; if any of the six cannot participate, then the house cannot be rented. In Phase 1 of this project, the organizer of the vacation contacts each person to verify availability and collect a sixth of the rent. If the organizer learns that even one person cannot participate, she contacts every member of the group individually to notify him or her that the house cannot be rented. If, however, each member of the group confirms availability and pays one-sixth of the rent, then Phase 1 concludes successfully. In Phase 2 of the project, the organizer notifies each member of the group that the vacation will take place as planned. A two-phase transaction commit works in much the same way as the vacation planning project. In Phase 1 (referred to herein as the “prepare” phase), the transaction coordinator contacts potential participants in the transaction. The participants all agree to make the results of the transaction permanent but do not do so immediately. The participants log information to disk (i.e., prepare) to ensure they can complete Phase 2. If all the participants agree to commit, the coordinator logs that agreement and the outcome is decided. The recording of this agreement in the log ends Phase 1. In Phase 2 (referred to as the “commit” phase herein), the coordinator informs each participant of the decision, and they permanently update (commit) their resources using a resource manager.

[0005] An issue that occurs in distributed transactions is that getting the correct value for transaction time-to-live can be complicated. To prevent heuristic outcomes, the transaction time-to-live for the transaction coordinator and the time-to-live values of the transaction participants must be in a specific order. That is, the transaction coordinator time-to-live value must be less than the time-to-live value associated with any resource manager involved in the transaction. If a particular enlisted resource manager has a time-to-live value less than the transaction coordinator time-to-live value, then the resource manager may roll back its transaction (e.g., a branch transaction) without the transaction coordinator knowing that the particular resource manager did not commit its portion of the distributed transaction. If this happens after the transaction coordinator has prepared the transaction, then it is likely to result in a heuristic outcome. As used herein, a “heuristic outcome” is a transaction outcome where the transaction manager and any resource manager have a different view of the outcome of the transaction.

[0006] Normally, a resource manager should not roll back a prepared transaction; however, there is nothing to prevent this. In fact, if a resource manager times out, the next step is to roll back the transaction, even for a prepared branch that is part of a distributed transaction. There may be cases where it is simply impractical to not allow a resource manager to roll back a prepared transaction. Even if the timeout occurs before the prepare phase, the transaction coordinator will not know about this until the initiator of the distributed transaction attempts to commit or roll back the transaction. This means that the transaction may remain active long after there is no possibility of committing.

[0007] In the above example, consider a scenario where the transaction coordinator prepares the six participants to commit the transaction for paying one-sixth of the rent, and one particular resource manager times out before committing its portion of the distributed transaction (its branch of the distributed transaction). In this scenario, five of the six participants have committed the branches of the transaction that pay their shares of the rent, but one participant rolls back its portion. The transaction coordinator incorrectly continues as if all six participants committed their transactions. This is possible because the transaction coordinator allows the transaction to be active beyond the time-to-live values of the participants.

[0008] Consider another example where a first participant transfers money to a second participant. The first participant performs a branch of the transaction to withdraw an amount of money, such as $100, and the second participant performs a branch of the transaction to deposit the same amount of money. If both participants prepare the transaction but the resource manager for the second participant times out before committing its portion of the transaction, then the money is withdrawn from the first participant and not deposited to the second participant. The transaction coordinator continues as if both portions of the transaction have committed. This is a heuristic outcome where the $100 no longer exists in either participant's account. Thus, there is a need to configure timeouts to avoid heuristic outcomes.

[0009] The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Further, it should not be assumed that any of the approaches described in this section are well-understood, routine, or conventional merely by virtue of their inclusion in this section.BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In the drawings:

[0011] FIG. 1 is a block diagram illustrating a microservices architecture in which aspects of the embodiments can be implemented.

[0012] FIG. 2 is a block diagram illustrating the use of interceptors in accordance with an embodiment.

[0013] FIG. 3A is a block diagram illustrating extended architecture communication between an initiator service and a resource manager in accordance with an embodiment.

[0014] FIG. 3B is a block diagram illustrating a resource manager proxy for extended architecture transaction management between an initiator service and a resource manager in accordance with an embodiment.

[0015] FIG. 4 is a block diagram illustrating an example application in a microservices architecture in accordance with an embodiment.

[0016] FIGS. 5A and 5B are continuous portions of an example data flow diagram illustrating a distributed transaction in a microservices architecture with timeout aggregation in accordance with an embodiment.

[0017] FIG. 6 is a flowchart illustrating aggregating timeouts for distributed transactions in a microservice architecture in accordance with an embodiment.

[0018] FIG. 7 is a block diagram that illustrates a computer system upon which aspects of the illustrative embodiments may be implemented.

[0019] FIG. 8 is a block diagram of a basic software system that may be employed for controlling the operation of a computer system upon which aspects of the illustrative embodiments may be implemented.DETAILED DESCRIPTION

[0020] In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, that the present invention may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to avoid unnecessarily obscuring the present invention.General Overview

[0021] The illustrative embodiments attempt to minimize heuristic outcomes of distributed transactions. In accordance with the illustrative embodiments, each participant service is configured to communicate the time-to-live value of its resource manager to the transaction coordinator when enlisting in a distributed transaction. The transaction coordinator dynamically sets its time-to-live value to be less than the time-to-live values of all the participant services. In one embodiment, the transaction coordinator has a default time-to-live value and sets the time-to-live value for a distributed transaction to a minimum of the default time-to-live value and the time-to-live values of the participant services, minus some time to account for timing skew. This ensures that the transaction coordinator will timeout the distributed transaction before any enlisted resource managers timeout.

[0022] One possible solution to the problem of time-to-live values is to manually ensure that all participants in a distributed transaction have time-to-live values greater than the time-to-live value of the transaction coordinator. As a manual process, it is subject to errors that can lead to heuristic outcomes, which is extremely undesirable. Furthermore, a microservices application may involve services or resource managers that are not known at the time of setting the transaction time-to-live value in the transaction coordinator. The solution of the illustrative embodiments decreases the likelihood that a resource manager will timeout after a distributed transaction has prepared to commit without having a priori knowledge about which resource managers will be involved in the transaction. The solution of the illustrative embodiments also reduces manual intervention needed due to distributed transactions not committing properly.Microservices Architecture for Distributed Transactions

[0023] FIG. 1 is a block diagram illustrating a microservices architecture in which aspects of the embodiments can be implemented. In the depicted example, an application is built including a transaction initiator application 110, participant application 120, and participant application 130, which are services in the microservices architecture. User 101 calls transaction initiator application 110 using ingress gateway 105 to initiate a transaction. During execution of the transaction, transaction initiator application 110 can perform the transaction entirely using resources that are local to transaction initiator application 110 using one or more resource managers 115. Alternatively, transaction initiator application 110 can make a service call to participant application 120, participant application 130, or both. Participant application 120 and participant application 130 can also use resources utilizing one or more resource managers 125, 135.Transaction Coordinator

[0024] Transaction coordinator 150, also referred to as microservices transaction (MicroTx) coordinator or transaction manager, is a service that coordinates transactions that involve resource managers at multiple services, such as applications (services) 110, 120, 130, to ensure consistency and atomicity of transactions across services. Each service includes a client library for communicating and coordinating with the transaction coordinator 150. Thus, transaction initiator application 110 includes MicroTx client library 112, participant application 120 includes MicroTx client library 122, and participant application 130 includes MicroTx client library 132. Transaction initiator application 110 makes a call to the transaction coordinator 150, using the MicroTx client library 112, to enlist as a participant in the transaction. A distributed transaction has an associated global transaction identifier (GTRID), and each service uses the GTRID to enlist in the distributed transaction.

[0025] Transaction coordinator 150 provides a set of REST services including long-running actions coordinator 151, extended architecture (XA) coordinator 152, and try-confirm / cancel coordinator 153. Long-running actions (LRA) coordinator 151 is a service that participant applications register with and is responsible for driving completion or compensation of a long running action. LRA transactions provide eventual consistency, and users may see inconsistent updates across resources for the duration of the distributed transaction, such as an Eclipse MicroProfile LRA. Development with LRAs can be more complex as users are required to write and test compensate business logic.

[0026] Try-confirm / cancel coordinator 153 uses a protocol that has an initiator ask other services to reserve resources or place them in escrow. Once the initiator 110 and all participant services 120, 130 have acquired the necessary reservations, the initiator 110 then asks transaction coordinator 150 to confirm all of the reservations. During the try phase, all accepted reservations are collected in headers by the MicroTx client library 112. This includes reservations made indirectly by services called by the initiator. By the time the initiator 110 has completed making reservations with participant application (service) 120 and participant application (service) 130, the MicroTx client library 112 has collected all the reservations in headers. At this point, in the confirm / cancel phase, the initiator can decide to confirm the reservations, cancel the reservations, or ignore the reservations by letting timeouts eventually cancel the reservations. Try-confirm / cancel coordinator 153 is used for services that need to place resources in reserve.Extended Architecture (XA) Transactions

[0027] XA coordinator 152 provides an extended architecture (XA) transaction protocol for applications that require strong global consistency for distributed transactions. XA offers strong data consistency with low development complexity. XA transaction protocol eliminates the need for an application-specific business log to ensure consistency. Example implementations are described below with reference to the XA transaction protocol for ease of illustration; however, other implementations may be within the spirit and scope of the embodiments described herein.

[0028] Application services communicate with resource managers using a resource manager interface, and the resource managers return results. An example of a resource manager is a database management system; however, other resource managers may be used, such as messaging services, Java™ application servers, etc. Application services communicate with the transaction coordinator using transaction demarcation calls, and the transaction coordinator returns a status of the transaction. The transaction coordinator makes XA calls to the resource managers, and the resource managers return a status. A distributed transaction has a global transaction identifier (GTRID), an XA transaction has an XA transaction identifier (XID), and the XA calls include the XID of the XA transaction. The XID contains the GTRID along with the transaction branch ID (BQUAL). The GTRID ties all the branches together, while the XID is unique to a specific branch of the transaction. In some embodiments, the transaction coordinator makes calls to the resource managers using proxies, as will be described in further detail below.

[0029] An XA transaction uses a two-phase commit protocol, which provides strong consistency across multiple resource managers. The XA transaction protocol maintains ACID (Atomicity, Consistency, Isolation, and Durability) properties. The XA transaction protocol is mostly transparent to the application services. Developers only use transaction APIs or annotations to demarcate transaction boundaries (begin, commit, abort, etc.). The XA transaction protocol also has built-in support for many resource managers, such as enterprise databases. The two-phase commit protocol ensures data integrity by coordinating single transactions accessing multiple relational databases. XA guarantees that transactional updates are committed in all of the participating databases or are fully rolled back out of all of the databases, reverting to the state prior to the start of the transaction.

[0030] The XA specification defines the interactions between the transaction coordinator 150 and each resource manager 115, 125, 135. The transaction coordinator 150, also known as the XA coordinator, manages XA or distributed (global) transactions. Each resource manager 115, 125, 135 manages a particular resource, such as a database or a Java™ messaging service (JMS) system. In addition, an XA resource exposes a set of methods or functions for managing the resource.

[0031] In order to be involved in an XA transaction, the XA resource must make itself known to the transaction coordinator. This process is referred to herein as enlistment. Once an XA resource is enlisted, the transaction coordinator 150 ensures that the XA resource takes part in a transaction and makes the appropriate method calls on the XA resource during the lifetime of the transaction. In an embodiment, a participant service enlists a resource manager by sending, using its MicroTx library, a message to the transaction coordinator identifying the resource manager using a resource manager identifier.

[0032] For an XA transaction to complete, all the resource managers 115, 125, 135 participate in a two-phase commit, as explained above. In the first phase, the transaction coordinator asks each of the resource managers (through the enlisted XA resource) whether they will encounter any problems committing the transaction. If any resource manager objects to committing the transaction, then all work done by any party on any resource involved in the XA transaction must all be rolled back. The transaction coordinator calls the rollback( ) method on each of the enlisted XA resources. However, if no resource managers object to committing, then the second phase involves the transaction coordinator actually calling the commit( ) method on each of the enlisted XA resources. This process guarantees the ACID (atomicity, consistency, isolation, and durability) properties of a transaction that can span multiple resources.

[0033] As explained above, an issue that occurs when using XA transactions is that getting the correct value for time-to-live can be complicated. The time-to-live value is an amount of time the transaction coordinator will allow the distributed transaction to be active and consequently locks to be kept on resources. In some implementations, the services that will be involved in a distributed transaction are not known ahead of time. The transaction coordinator 150 is configured with a default time-to-live value for the distributed transaction; however, each resource manager 115, 125, 135 also has an associated time-to-live value.

[0034] When the transaction coordinator detects that the transaction has timed out (i.e., the transaction has no more time to live), it will call all of the enlisted participants to roll back the transaction. The resource managers themselves have a time-to-live value defining the maximum amount of time they will allow a distributed transaction to remain active before rolling it back on its own, unknown to the coordinator. The illustrative embodiments attempt to avoid the resource managers timing out and rolling back the distributed transaction, thus ensuring the coordinator times out the transaction before any resource manager times out its part (branch) of the transaction. To prevent heuristic outcomes, the time-to-live values for the transaction coordinator and the transaction participants must be in a specific order. That is, the transaction coordinator time-to-live value must be less than the time-to-live value associated with any resource manager involved in the transaction.

[0035] In accordance with the illustrative embodiments, the transaction coordinator 150 is informed of the time-to-live value of each resource manager 115, 125, 135 during enlistment. When each participant and its resource manager is enlisted in the transaction, the time-to-live value of the resource manager is communicated to the transaction coordinator. Then, the transaction coordinator 150 can set the time-to-live value of the distributed transaction based on the time-to-live values of the resource managers 115, 125, 135.

[0036] While the embodiments are described with reference to XA transactions and two-phase commit, the aspects of the embodiments apply beyond the XA specification. For example, the aspects of the embodiments may apply to try-confirm / cancel (TCC), other extensions to existing standards for commit protocols with coordinators, proprietary commit protocols with coordinators, or future commit protocols with coordinators.Interceptors

[0037] FIG. 2 is a block diagram illustrating the use of interceptors in accordance with an embodiment. Application code 211 in client application 210 communicates with application code 221 in server application 220. Application code 211 comprises a REST client that sends a REST request to application code 221, which is a REST server. Application code 221 processes the request and returns a reply to application code 211. In client application 210, interceptor 212 includes logic to intercept an outgoing REST request and add transaction headers to the REST request. Interceptor 212 also includes logic to interpret transaction headers from a reply received from server application 220. In server application 220, interceptor 222 includes logic to interpret transaction headers from a request received from client application 210 and to intercept an outgoing reply and add transaction headers to the reply.

[0038] Interceptors perform a variety of functions to allow a transaction coordinator 250 to manage a distributed transaction. One such function is to enlist resource managers as participants in a distributed transaction by sending an “enlist” call to transaction coordinator 250. In server application 220, interceptor 222 includes logic to intercept a REST request received from client application 210 and to enlist a resource manager of server application 220 as a participant in the transaction based on the transaction headers in the request. In accordance with the embodiment, the enlist call includes time-to-live information associated with a resource manager of server application 220. This allows the transaction coordinator to consider the time-to-live information of resource managers enlisted in a distributed transaction when setting a transaction time-to-live value for the distributed transaction.Resource Manager Proxy

[0039] FIG. 3A is a block diagram illustrating extended architecture transaction management between an initiator service and a resource manager in accordance with an embodiment. Initiator 310 initiates a transaction and makes some calls to application code 311, which performs operations on resource manager 315. For example, initiator 310 may be a product ordering service that calls application code 311 of an inventory service, which performs data manipulation language (DML) operations on a database (RM 315). When initiator 310 calls transaction coordinator 350 to indicate that it wants to begin, commit, or rollback a transaction, the transaction coordinator 350 performs corresponding XA operations on resource manager 315. Transaction coordinator 350 may have its own connection to resource manager 315. This approach requires that transaction manager 350 to have appropriate software libraries to perform operations with the particular resource manager 315 and also to have appropriate credentials.

[0040] FIG. 3B is a block diagram illustrating a resource manager proxy for extended architecture transaction management between an initiator service and a resource manager in accordance with an embodiment. In this approach, initiator 310 initiates a transaction and makes some calls to application code 311, which performs operations on resource manager 315; however, when initiator 310 calls transaction coordinator 350 to indicate that it wants to begin, commit, or rollback a transaction, the transaction coordinator 350 relays the corresponding XA operations to the participant application code 311. Interceptor 312 directs the XA operations to MicroTx client library 313, which hands the XA calls to resource manager (RM) proxy 314. In one embodiment, RM proxy 314 is a REST service provided by and contained in MicroTx client library 313, thus embedded within the application microservice. Interceptor 312 may also be contained within the MicroTx client library 313, thus embedded within the application microservice. MicroTx client library 313 provides REST callbacks for resource manager operations.

[0041] RM proxy 314 has the appropriate software libraries and credentials to perform XA operations on resource manager 315. The RM Proxy 314 is resource manager agnostic. It requires that the application uses an injected connection to the RM. Depending upon the framework (Helidon, Spring Boot, etc.) and database access (JDBC, Hibernate, etc.) the RM proxy may use an injected XADataSource or an Entity Manager that is using an XADataSource. The RM Proxy in the Java™ case just uses the XAResource of the underlying connection. Thus, both the transaction manager and the RM proxy are agnostic to the resource managers of each of the participant services.

[0042] Resource manager proxies are described in further detail in U.S. Publication 2023 / 0224376, entitled “METHOD AND SYSTEM TO IMPLEMENT PROXYING FOR OPERATIONS THROUGH AN APPLICATION PROGRAM FOR A TRANSACTION MANAGER,” filed Jan. 7, 2022, which is hereby incorporated by reference as if fully set forth herein.Example Application in Microservices Architecture

[0043] FIG. 4 is a block diagram illustrating an example application in a microservices architecture in accordance with an embodiment. Teller service 410 receives a transfer request from a user or actor 401 and initiates a transaction. As configured, the application is designed to use teller service 410, department1 service 420, and department2 service 430. Teller service 410 includes MicroTx client library 412, department1 service 420 includes MicroTx client library 422, and department2 service 430 includes MicroTx client library 432. In this example, teller service 410 does not use a resource manager; however, aspects of the embodiments can apply to applications in which initiators are participants and use resource managers. Department1 service 420 uses RM1 425. Department2 service 430 uses RM2 435.

[0044] Teller service 410 links with MicroTx client library 412, which sends a REST call to transaction coordinator 450 to begin the transaction. In response to receiving the transfer request, teller service 410 sends a withdraw request to department1 service 420. Department1 service 420 links with MicroTx client library 422, which sends a REST call to transaction coordinator 450 to enlist department1 service 420 as a participant in the distributed transaction. The withdrawal is performed as a branch of the transaction. Department1 service 420 uses XA operations to coordinate the withdrawal as a branch of the distributed transaction for the transfer request. Department1 service 420 uses DML operations to perform operations for the withdraw branch of the transaction on RM1 425.

[0045] In response to a reply from department1 service 420 indicating the withdrawal is complete, teller service 410 sends a deposit request to department2 service 430. Department2 service 430 links with MicroTx client library 432, which sends a REST call to transaction coordinator 450 to enlist department2 service 430 as a participant in the distributed transaction. The deposit is performed as a branch of the transaction. Department2 service 430 uses XA operations to coordinate the deposit as a branch of the distributed transaction for the transfer request. Department2 service 430 uses DML operations to perform operations for the deposit branch of the transaction on RM1 435.

[0046] In response to a reply from department2 service 430 indicating the deposit is complete, teller service 410 calls the transaction coordinator to commit the transaction. The XA protocol uses two-phase commit. In response to teller service 410 calling the transaction coordinator to commit the transaction, transaction coordinator 450 sends a “prepare” message to each participant service asking if the resource manager being used by the participant service is prepared to commit the results of the transaction, and each participant service returns a reply indicating whether the resource manager is prepared to commit. The transaction coordinator calls back to the participants via a service the MicroTX library provides in the participant. The library in the participant service acts as a proxy for the resource manager. There is an additional service in each participant that is provided by the client library. A simple service for incoming REST callbacks from the coordinator to the participant proxies requests to the resource manager(s) for operations such as xa_prepare( ), xa_commit( ), and xa_rollback( ), among others. That is, the transaction coordinator sends XA requests by way of the participant services that enlisted them. If all resource managers return that they are prepared for commit, then transaction coordinator 450 sends a “commit” message instructing each resource manager to commit results. If any resource manager replies that it cannot commit the transaction, then transaction coordinator 450 sends a “rollback” message instructing all resource managers to roll back results.

[0047] The entire distributed transaction, including the withdrawal branch and the deposit branch, should commit together. Either the entire distributed transaction should commit, or the entire distributed transaction should be rolled back. However, if a resource manager has a time-to-live value that is shorter than the time-to-live value configured for the distributed transaction in the transaction coordinator, then it is possible for a resource manager to timeout after preparing to commit. This creates a scenario where the transaction coordinator assumes that all resource managers will commit and return a success result to the initiator even though one or more of the services did not commit results.

[0048] In the example shown in FIG. 4, consider RM1 425 and RM2 435 prepare to commit and then RM2 435 times out before committing the results of the transaction. Transaction coordinator 350 assumes all resource managers will commit and return a result indicating a successful transaction. However, the “withdraw” branch will be committed by RM1 425 but the “deposit” branch will be rolled back by RM2 435. The “transfer” transaction appears to be complete; however, the amount withdrawn from department1 will be in limbo, i.e., withdrawn but not deposited. This is a heuristic outcome that will have to be rectified. The initiating transfer gets a response from the commit call to the coordinator that the commit failed with a heuristic outcome. If the “deposit” branch is rolled back due to a timeout after receiving the request to commit, then the resource manager is required to report the heuristic outcome as part of its return code to the transaction coordinator.

[0049] The illustrative embodiments address the above timeout issue by configuring the participant services to communicate the time-to-live values of their respective resource managers to the transaction coordinator. In one embodiment, the transaction coordinator is configured with a default time-to-live value. As long as the coordinator time-to-live value is less than the time-to-live values of the resource managers, then the transaction coordinator can continue with the distributed transaction without a risk of a resource manager timing out before the transaction coordinator times out.

[0050] However, if any resource manager has a time-to-live value that is less than the coordinator time-to-live value, then the transaction coordinator sets the time-to-live value of the distributed transaction to a time-to-live value that is less than or equal to the shortest time-to-live value. In one embodiment, the transaction coordinator sets the time-to-live value of the distributed transaction to a minimum of the default time-to-live value and the time-to-live values of resource manager less some time to account for timing skew.

[0051] FIGS. 5A and 5B are continuous portions of an example data flow diagram illustrating a distributed transaction in a microservices architecture with timeout aggregation in accordance with an embodiment. With reference to FIG. 5A, teller service 410 receives a transfer request ( / transfer) from actor 401 (e.g., a user) and issues an XA transaction begin call to transaction coordinator 450 to initiate a distributed transaction. In this example, teller service 410 does not use a resource manager.

[0052] As part of the transfer transaction, teller service 410 sends a withdraw request ( / withdraw) to department1 service 420, which includes its MicroTx client library, with the XA transaction protocol identifier (GTRID) in the link header. In response to receiving the withdraw request, department1 service 420 performs enlist operation 510 to enlist its resource manager with the transaction coordinator 450 by having its MicroTx client library (e.g., an interceptor as described above with reference to FIG. 2) send a GTRID and RMID for its resource manager (RM1 425). Transaction coordinator 450 returns an XID for operations performed using RM1 425. In accordance with the embodiment, enlist operation 510 includes timeout aggregation. Thus, the enlist request ( / enlist) includes a time-to-live value associated with RM1 425 (timeout1).

[0053] Department1 service 420 then sends an XA start with the XID to RM1 425 to tell the resource manager that operations performed on RM1 425 are part of a distributed XA transaction. This begins a branch ( / withdraw) between department1 service 420 and RM1 425, which is part of the distributed transaction ( / transfer). In this example RM1 425 and RM2 435 are databases. Department1 service 420 then performs one or more DML operations on RM1 425. When all DML operations are completed, department1 service 420 sends an XA end with the XID to RM1 425 to signal the end of the branch. Department1 service 420 then sends a withdraw reply to teller service 410 indicating completion of the withdraw portion of the distributed transaction.

[0054] Teller service 410 then sends the deposit request ( / deposit) to department2 service 430 with the XA transaction protocol identifier (GTRID) in the link header. In response to receiving the deposit request, department2 service 430 performs enlist operation 520 to enlist its resource manager with the transaction coordinator 450 by having its MicroTx client library (e.g., an interceptor as described above with reference to FIG. 2) send a GTRID and RMID for RM2 435. Transaction coordinator 450 returns an XID for operations performed using RM2 435. In accordance with the embodiment, enlist operation 520 includes timeout aggregation. Thus, the enlist request ( / enlist) includes a time-to-live value associated with RM2 435 (timeout2).

[0055] Department2 service 430 then sends an XA start with the XID to RM2 435 to tell the resource manager that operations performed on RM2 435 are part of a distributed XA transaction. This begins a branch ( / deposit) between department2 service 430 and RM2 435, which is part of the distributed transaction ( / transfer). Department2 service 430 then performs one or more DML operations on RM2 435. When all DML operations are completed, department2 service 430 sends an XA end with the XID to RM2 435 to signal the end of the branch transaction. Department2 service 430 then sends a deposit reply to teller service 410 indicating completion of the deposit portion of the distributed transaction.

[0056] Turning to FIG. 5B, with the withdraw and deposit portions of the transfer distributed transaction complete, teller service 410 sends a transaction commit to transaction coordinator 450 to commit all branches of the distributed transaction. Teller service 410 makes a REST call to transaction coordinator 450 asking it to commit the transaction, which begins a two-phase commit of all operations within the distributed transaction, including a prepare phase 530 and a commit phase 540.

[0057] In the prepare phase 530, transaction coordinator 450 sends a prepare message with the XID of the distributed transaction to department1 service 420 (e.g., a proxy in service 420 as described above with reference to FIG. 3B), which then performs an XA prepare on RM1 425 and returns a result. Transaction coordinator 450 also sends a prepare message with the XID of the distributed transaction to department2 service 430 (e.g., a proxy in service 430 as described above with reference to FIG. 3B), which then performs an XA prepare on RM2 435 and returns a result. Note that the order of these events within the prepare and commit phases is irrelevant. They can be done sequentially or in parallel, but the prepare phase 530 must be performed before the commit phase 540.

[0058] In the commit phase 540, transaction coordinator 450 sends a commit message with the XID of the distributed transaction to department1 service 420 (e.g., a proxy in service 420 as described above with reference to FIG. 3B), which then performs an XA commit on RM1 425 and returns a result. Transaction coordinator 450 also sends a commit message with the XID of the distributed transaction to department2 service 430 (e.g., a proxy in service 430 as described above with reference to FIG. 3B), which then performs an XA commit on RM2 435 and returns a result.

[0059] After all branches are committed, transaction coordinator 450 sends a commit response for the distributed transaction to teller service 410. After the distributed transaction for the transfer request is committed, teller service 410 sends a response for the transfer request to actor 401.

[0060] After receiving timeout information for the participant services and prior to initiating commit, the transaction coordinator 450 sets the transaction time-to-live value to a minimum of the time-to-live values, minus some time for time skew. This ensures that the transaction time-to-live value in the transaction coordinator is less than any time-to-live value associated with a resource manager. That is, transaction coordinator 450 will time out before any resource manager times out. This prevents a resource manager from timing out during commit, and only the transaction coordinator 450 can time out the transaction.

[0061] FIG. 6 is a flowchart illustrating aggregating timeouts for distributed transactions in a microservice architecture in accordance with an embodiment. Operation begins when an initiator service initiates a distributed transaction (block 600). As part of initiating the distributed transaction, the initiator may also send requests to participant services. The transaction coordinator then starts a timer for the distributed transaction (block 601). In one embodiment, starting the timer comprises setting a timer to zero and causing the timer to begin counting up. Alternatively, starting the timer may comprise setting the timer to a default time-to-live value and causing the timer to begin counting down.

[0062] Each participant service sends a call, with time-to-live information of their resource managers, to enlist in the distributed transaction (block 602). In accordance with the embodiment, a call from a particular service to enlist in the distributed transaction communicates information identifying its resource manager(s), including one or more time-to-live values.

[0063] In one example embodiment, if a participant service has multiple resource managers, then the participant service can communicate all time-to-live values of the resource managers to the transaction coordinator. Alternatively, the participant service can communicate a minimum of the time-to-live values associated with the participant service. In some embodiments, the participant service itself may have a time-to-live value.

[0064] The transaction coordinator then resets the transaction time-to-live based on its default time-to-live value and the time-to-live values associated with the participant services and their resource managers (block 603). In one embodiment, the transaction coordinator sets the time-to-live value of the distributed transaction to a minimum of the default time-to-live value and the time-to-live values of resource managers less some time to account for timing skew. In one embodiment, the transaction coordinator determines whether the transaction times out by comparing the timer to the time-to-live value. However, in the alternative embodiment where the timer was initially set to the default time-to-live value, resetting the transaction time-to-live value may include resetting timer based on a difference between the default time-to-live value and the new time-to-live value.

[0065] When all work of the participant services has been completed and reported as successful to the initiator, the initiator requests the coordinator to commit the transaction (block 604). The transaction then determines whether the transaction has time to live (block 605). In one embodiment, the transaction coordinator determines whether the transaction has time to live by comparing the timer to the time-to-live value. If the timer is less than the time-to-live value, then the transaction has time to live; otherwise, the transaction times out. Alternatively, for a timer that counts down from a time-to-live value, the transaction coordinator determines whether the transaction has time to live by determining if the timer has reached zero.

[0066] If the transaction does not have time to live (block 605: No), then the transaction coordinator rolls back the transaction (block 606), and then the transaction coordinator returns a failure result to the initiator (block 611), and operation ends (block 607). If the transaction has time to live (block 605: Yes), then the transaction coordinator initiates a commit of the distributed transaction (block 608) and determines whether the distributed transaction commits successfully (block 609). In some embodiments, the distributed transaction commits in a two-phase commit process. That is, the initiator calls the transaction coordinator to commit the transaction, and the transaction coordinator sends a “prepare” message to the participants of the distributed transaction. If all participants reply that they are prepared for commit, then the transaction coordinator sends a “commit” message instructing the resource managers to commit results. The distributed transaction commits successfully in block 609 if all participants commit results and complete the two-phase commit process.

[0067] If the distributed transaction commits successfully (block 609: Yes), then the transaction coordinator returns a success result to the initiator (block 610), and operation ends (block 607). If the distributed transaction does not commit successfully (block 609: No), then the transaction coordinator returns a failure result to the initiator (block 611), and operation ends (block 607).

[0068] In some embodiments, once the transaction coordinator initiates the commit, the transaction coordinator will attempt to make sure all resource managers commit. The only timeouts that can happen during commit are timeouts for coordinator-to-participant requests, which have a separate timeout value. In a two-phase commit, these coordinator-to-participant requests include / prepare and / commit requests. If any of these coordinator-to-participant requests times out, then the transaction coordinator may retry the pending request (e.g., / prepare or / commit) or abandon the transaction. The transaction coordinator may retry these requests until the coordinator gets a response or abandons the transaction. Abandonment is optional. The result of retrying the request or abandoning the transaction is either a commit or abandonment of the transaction.Hardware Overview

[0069] According to one embodiment, the techniques described herein are implemented by one or more special-purpose computing devices. The special-purpose computing devices may be hard-wired to perform the techniques or may include digital electronic devices such as one or more application-specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs) that are persistently programmed to perform the techniques or may include one or more general purpose hardware processors programmed to perform the techniques pursuant to program instructions in firmware, memory, other storage, or a combination. Such special-purpose computing devices may also combine custom hard-wired logic, ASICs, or FPGAs with custom programming to accomplish the techniques. The special-purpose computing devices may be desktop computer systems, portable computer systems, handheld devices, networking devices or any other device that incorporates hard-wired and / or program logic to implement the techniques.

[0070] For example, FIG. 7 is a block diagram that illustrates a computer system 700 upon which aspects of the illustrative embodiments may be implemented. Computer system 700 includes a bus 702 or other communication mechanism for communicating information, and a hardware processor 704 coupled with bus 702 for processing information. Hardware processor 704 may be, for example, a general-purpose microprocessor.

[0071] Computer system 700 also includes a main memory 706, such as a random-access memory (RAM) or other dynamic storage device, coupled to bus 702 for storing information and instructions to be executed by processor 704. Main memory 706 also may be used for storing temporary variables or other intermediate information during execution of instructions to be executed by processor 704. Such instructions, when stored in non-transitory storage media accessible to processor 704, render computer system 700 into a special-purpose machine that is customized to perform the operations specified in the instructions.

[0072] Computer system 700 further includes a read only memory (ROM) 708 or other static storage device coupled to bus 702 for storing static information and instructions for processor 704. A storage device 710, such as a magnetic disk, optical disk, or solid-state drive is provided and coupled to bus 702 for storing information and instructions.

[0073] Computer system 700 may be coupled via bus 702 to a display 712, such as a cathode ray tube (CRT), for displaying information to a computer user. An input device 714, including alphanumeric and other keys, is coupled to bus 702 for communicating information and command selections to processor 704. Another type of user input device is cursor control 716, such as a mouse, a trackball, or cursor direction keys for communicating direction information and command selections to processor 704 and for controlling cursor movement on display 712. This input device typically has two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), that allows the device to specify positions in a plane.

[0074] Computer system 700 may implement the techniques described herein using customized hard-wired logic, one or more ASICs or FPGAs, firmware and / or program logic which in combination with the computer system causes or programs computer system 700 to be a special-purpose machine. According to one embodiment, the techniques herein are performed by computer system 700 in response to processor 704 executing one or more sequences of one or more instructions contained in main memory 706. Such instructions may be read into main memory 706 from another storage medium, such as storage device 710. Execution of the sequences of instructions contained in main memory 706 causes processor 704 to perform the process steps described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions.

[0075] The term “storage media” as used herein refers to any non-transitory media that store data and / or instructions that cause a machine to operate in a specific fashion. Such storage media may comprise non-volatile media and / or volatile media. Non-volatile media includes, for example, optical disks, magnetic disks, or solid-state drives, such as storage device 710. Volatile media includes dynamic memory, such as main memory 706. Common forms of storage media include, for example, a floppy disk, a flexible disk, hard disk, solid-state drive, magnetic tape, or any other magnetic data storage medium, a CD-ROM, any other optical data storage medium, any physical medium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROM, NVRAM, any other memory chip or cartridge.

[0076] Storage media is distinct from but may be used in conjunction with transmission media. Transmission media participates in transferring information between storage media. For example, transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise bus 702. Transmission media can also take the form of acoustic or light waves, such as those generated during radio-wave and infra-red data communications.

[0077] Various forms of media may be involved in carrying one or more sequences of one or more instructions to processor 704 for execution. For example, the instructions may initially be carried on a magnetic disk or solid-state drive of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to computer system 700 can receive the data on the telephone line and use an infra-red transmitter to convert the data to an infra-red signal. An infra-red detector can receive the data carried in the infra-red signal and appropriate circuitry can place the data on bus 702. Bus 702 carries the data to main memory 706, from which processor 704 retrieves and executes the instructions. The instructions received by main memory 706 may optionally be stored on storage device 710 either before or after execution by processor 704.

[0078] Computer system 700 also includes a communication interface 718 coupled to bus 702. Communication interface 718 provides a two-way data communication coupling to a network link 720 that is connected to a local network 722. For example, communication interface 718 may be an integrated services digital network (ISDN) card, cable modem, satellite modem, or a modem to provide a data communication connection to a corresponding type of telephone line. As another example, communication interface 718 may be a local area network (LAN) card to provide a data communication connection to a compatible LAN. Wireless links may also be implemented. In any such implementation, communication interface 718 sends and receives electrical, electromagnetic, or optical signals that carry digital data streams representing various types of information.

[0079] Network link 720 typically provides data communication through one or more networks to other data devices. For example, network link 720 may provide a connection through local network 722 to a host computer 724 or to data equipment operated by an Internet Service Provider (ISP) 726. ISP 726 in turn provides data communication services through the world-wide packet data communication network now commonly referred to as the “Internet”728. Local network 722 and Internet 728 both use electrical, electromagnetic, or optical signals that carry digital data streams. The signals through the various networks and the signals on network link 720 and through communication interface 718, which carry the digital data to and from computer system 700, are example forms of transmission media.

[0080] Computer system 700 can send messages and receive data, including program code, through the network(s), network link 720 and communication interface 718. In the Internet example, a server 730 might transmit a requested code for an application program through Internet 728, ISP 726, local network 722 and communication interface 718.

[0081] The received code may be executed by processor 704 as it is received, and / or stored in storage device 710, or other non-volatile storage for later execution.Software Overview

[0082] FIG. 8 is a block diagram of a basic software system 800 that may be employed for controlling the operation of computer system 700. Software system 800 and its components, including their connections, relationships, and functions, is meant to be exemplary only, and not meant to limit implementations of the example embodiment(s). Other software systems suitable for implementing the example embodiment(s) may have different components, including components with different connections, relationships, and functions.

[0083] Software system 800 is provided for directing the operation of computer system 700. Software system 800, which may be stored in system memory (RAM) 706 and on fixed storage (e.g., hard disk or flash memory) 710, includes a kernel or operating system (OS) 810.

[0084] The OS 810 manages low-level aspects of computer operation, including managing execution of processes, memory allocation, file input and output (I / O), and device I / O. One or more application programs, represented as 802A, 802B, 802C . . . 802N, may be “loaded” (e.g., transferred from fixed storage 710 into memory 706) for execution by system 800. The applications or other software intended for use on computer system 700 may also be stored as a set of downloadable computer-executable instructions, for example, for downloading and installation from an Internet location (e.g., a Web server, an app store, or other online service).

[0085] Software system 800 includes a graphical user interface (GUI) 815, for receiving user commands and data in a graphical (e.g., “point-and-click” or “touch gesture”) fashion. These inputs, in turn, may be acted upon by the system 800 in accordance with instructions from operating system 810 and / or application(s) 802. The GUI 815 also serves to display the results of operation from the OS 810 and application(s) 802, whereupon the user may supply additional inputs or terminate the session (e.g., log off).

[0086] OS 810 can execute directly on the bare hardware 820 (e.g., processor(s) 704) of computer system 700. Alternatively, a hypervisor or virtual machine monitor (VMM) 830 may be interposed between the bare hardware 820 and the OS 810. In this configuration, VMM 830 acts as a software “cushion” or virtualization layer between the OS 810 and the bare hardware 820 of the computer system 700.

[0087] VMM 830 instantiates and runs one or more virtual machine instances (“guest machines”). Each guest machine comprises a “guest” operating system, such as OS 810, and one or more applications, such as application(s) 802, designed to execute on the guest operating system. The VMM 830 presents the guest operating systems with a virtual operating platform and manages the execution of the guest operating systems.

[0088] In some instances, the VMM 830 may allow a guest operating system to run as if it is running on the bare hardware 820 of computer system 700 directly. In these instances, the same version of the guest operating system configured to execute on the bare hardware 820 directly may also execute on VMM 830 without modification or reconfiguration. In other words, VMM 830 may provide full hardware and CPU virtualization to a guest operating system in some instances.

[0089] In other instances, a guest operating system may be specially designed or configured to execute on VMM 830 for efficiency. In these instances, the guest operating system is “aware” that it executes on a virtual machine monitor. In other words, VMM 830 may provide para-virtualization to a guest operating system in some instances.

[0090] A computer system process comprises an allotment of hardware processor time, and an allotment of memory (physical and / or virtual), the allotment of memory being for storing instructions executed by the hardware processor, for storing data generated by the hardware processor executing the instructions, and / or for storing the hardware processor state (e.g., content of registers) between allotments of the hardware processor time when the computer system process is not running. Computer system processes run under the control of an operating system and may run under the control of other programs being executed on the computer system.Cloud Computing

[0091] The term “cloud computing” is generally used herein to describe a computing model which enables on-demand access to a shared pool of computing resources, such as computer networks, servers, software applications, and services, and which allows for rapid provisioning and release of resources with minimal management effort or service provider interaction.

[0092] A cloud computing environment (sometimes referred to as a cloud environment, or a cloud) can be implemented in a variety of different ways to best suit different requirements. For example, in a public cloud environment, the underlying computing infrastructure is owned by an organization that makes its cloud services available to other organizations or to the general public. In contrast, a private cloud environment is generally intended solely for use by, or within, a single organization. A community cloud is intended to be shared by several organizations within a community; while a hybrid cloud comprises two or more types of cloud (e.g., private, community, or public) that are bound together by data and application portability.

[0093] Generally, a cloud computing model enables some of those responsibilities which previously may have been provided by an organization's own information technology department, to instead be delivered as service layers within a cloud environment, for use by consumers (either within or external to the organization, according to the cloud's public / private nature). Depending on the particular implementation, the precise definition of components or features provided by or within each cloud service layer can vary, but common examples include: Software as a Service (SaaS), in which consumers use software applications that are running upon a cloud infrastructure, while a SaaS provider manages or controls the underlying cloud infrastructure and applications. Platform as a Service (PaaS), in which consumers can use software programming languages and development tools supported by a PaaS provider to develop, deploy, and otherwise control their own applications, while the PaaS provider manages or controls other aspects of the cloud environment (i.e., everything below the run-time execution environment). Infrastructure as a Service (IaaS), in which consumers can deploy and run arbitrary software applications, and / or provision processing, storage, networks, and other fundamental computing resources, while an IaaS provider manages or controls the underlying physical cloud infrastructure (i.e., everything below the operating system layer). Database as a Service (DBaaS) in which consumers use a database server or Database Management System that is running upon a cloud infrastructure, while a DbaaS provider manages or controls the underlying cloud infrastructure, applications, and servers, including one or more database servers.

[0094] In the foregoing specification, embodiments of the invention have been described with reference to numerous specific details that may vary from implementation to implementation. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense. The sole and exclusive indicator of the scope of the invention, and what is intended by the applicants to be the scope of the invention, is the literal and equivalent scope of the set of claims that issue from this application, in the specific form in which such claims issue, including any subsequent correction.

Claims

1. A method comprising:receiving a call from one or more services to enlist in a distributed transaction;identifying a participant time-to-live value of each of the one or more services based on the call received from each of the one or more services; andsetting, by a transaction coordinator, a transaction time-to-live value for the distributed transaction based at least in part on the participant time-to-live value received from each of the one or more services,wherein the method is performed by one or more computing devices.

2. The method of claim 1, wherein setting the transaction time-to-live value comprises:determining a minimum value of the participant time-to-live value of each of the one or more services and a default time-to-live value previously configured for the transaction coordinator; andsetting the transaction time-to-live value based on the minimum value.

3. The method of claim 1, wherein setting the transaction time-to-live value comprises:determining a minimum value of the participant time-to-live value of each of the one or more services and a default time-to-live value previously configured for the transaction coordinator; andsetting the transaction time-to-live value to the minimum value minus a predetermined time value.

4. The method of claim 1, wherein:each given service within the one or more services is associated with one or more resource managers,the participant time-to-live value of the given service corresponds to a time-to-live value for a given resource manager within the one or more resource managers.

5. The method of claim 1, wherein:each given service within the one or more services is associated with a resource manager,each given service within the one or more services has an interceptor,the interceptor intercepts a request from an initiator or another service and makes an enlist call to the transaction coordinator to enlist the resource manager as a participant in the distributed transaction, andthe enlist call includes a time-to-live value of the resource manager.

6. The method of claim 1, wherein:each given service within the one or more services is associated with one or more resource managers,each given service within the one or more services makes an enlist call to the transaction coordinator to enlist the one or more resource managers as participants in the distributed transaction, andthe enlist call further includes an identifier associated with each of the one or more resource managers.

7. The method of claim 1, wherein:the distributed transaction is associated with a global transaction identifier, andthe call includes the global transaction identifier.

8. The method of claim 1, further comprising:receiving a call from an initiator of the distributed transaction to commit the distributed transaction; andresponsive to receiving the call from the initiator to commit the distributed transaction, determining whether the distributed transaction times out based on the transaction time-to-live value.

9. A method comprising:sending, by a service in a microservices architecture, a call to a transaction coordinator to participant in a distributed transaction; andsending, from the service to the transaction coordinator, a participant time-to-live value corresponding to a resource manager associated with the service,wherein the transaction coordinator determines a transaction time-to-live value for the distributed transaction based at least in part on the participant time-to-live value,wherein the method is performed by one or more computing devices.

10. The method of claim 9, wherein:the service has an interceptor, andthe interceptor intercepts a request received from an initiator or another service and makes the call to the transaction coordinator in response to receiving the request from the initiator or another service.

11. The method of claim 9, wherein:the call further includes an identifier associated with the resource manager.

12. One or more non-transitory computer-readable media storing instructions which, when executed by one or more processors, cause:receiving a call from one or more services to enlist in a distributed transaction;identifying a participant time-to-live value from each of the one or more services based on the call received from each of the one or more services; andsetting, by a transaction coordinator, a transaction time-to-live value for the distributed transaction based at least in part on the participant time-to-live value received from each of the one or more services.

13. The one or more non-transitory computer-readable media of claim 12, wherein setting the transaction time-to-live value comprises:determining a minimum value of the participant time-to-live value of each of the one or more services and a default time-to-live value previously configured for the transaction coordinator; andsetting the transaction time-to-live value based on the minimum value.

14. The one or more non-transitory computer-readable media of claim 12, wherein setting the transaction time-to-live value comprises:determining a minimum value of the participant time-to-live value of each of the one or more services and a default time-to-live value previously configured for the transaction coordinator; andsetting the transaction time-to-live value to the minimum value minus a predetermined time value.

15. The one or more non-transitory computer-readable media of claim 12, wherein:each given service within the one or more services is associated with one or more resource managers,the participant time-to-live value of the given service corresponds to a time-to-live value of a given resource manager within the one or more resource managers.

16. The one or more non-transitory computer-readable media of claim 12, wherein:each given service within the one or more services is associated with a resource manager,each given service within the one or more services has an interceptor,the interceptor intercepts a request from an initiator or another service and makes an enlist call to the transaction coordinator to enlist the resource manager as a participant in the distributed transaction, andthe enlist call includes a time-to-live value of the resource manager.

17. The one or more non-transitory computer-readable media of claim 12, wherein:each given service within the one or more services is associated with one or more resource managers,each given service within the one or more services makes an enlist call to the transaction coordinator to enlist the one or more resource managers as participants in the distributed transaction, andthe enlist call further includes an identifier associated with each of the one or more resource managers.

18. The one or more non-transitory computer-readable media of claim 12, wherein:the distributed transaction is associated with a global transaction identifier, and the call includes the global transaction identifier.

19. The one or more non-transitory computer-readable media of claim 12, wherein the instructions, when executed by the one or more processors, further cause:receiving a call from an initiator of the distributed transaction to commit the distributed transaction; andresponsive to receiving the call from the initiator to commit the distributed transaction, determining whether the distributed transaction times out based on the transaction time-to-live value.

20. One or more non-transitory computer-readable media storing instructions which, when executed by one or more processors, cause:sending, by a service in a microservices architecture, a call to a transaction coordinator to participant in a distributed transaction; andsending, from the service to the transaction coordinator, a participant time-to-live value corresponding to a resource manager associated with the service,wherein the transaction coordinator determines a transaction time-to-live value for the distributed transaction based at least in part on the participant time-to-live value.