Disruption events such as machine random failures significantly impact the throughput of the line. Maintenance actions could restore the machines to certain health levels. A real-time scheduling of corrective maintenance (CM) is critical to improve the machines’ performance, hence to improve overall system productivity and quality. Due to the limited quantity of technicians or robots in manufacturing system, when, where and assign what type of maintenance is a complicated decision to make. A proper strategy to assign CM can greatly reduce permanent production lost, resource and energy consumption. In this paper, an online task allocation (OTA) method is provided to solve the assignment of CM for a stochastics serial production line. Case study is given to demonstrate the effectiveness of OTA method in assigning CM.