没有不值得去解决的问题,也没有不值得去学习的技术!

Video Upload Fails but Task Status Occasionally Shows “4: Under Review (Platform)” Instead of “3: Failed (Channel Publish)”: Queue Execution Order Amplifies the Bug

After a video upload fails, the channel application task status occasionally shows [4: Under Review (Platform)] instead of [3: Failed (Channel Publish)]. Checking the publish log table, 1 Douyin content item was sent to 5 Douyin accounts at the same time. Video uploads failed for 3 of these accounts. The channel application task IDs are: 159, 162, and 163.

1. After a video upload fails, the channel application task status occasionally shows [4: Under Review (Platform)] instead of [3: Failed (Channel Publish)]. Checking the publish log table, 1 Douyin content item was sent to 5 Douyin accounts at the same time. Video uploads failed for 3 of these accounts. The channel application task IDs are: 159, 162, and 163. See Figure 1.

After a video upload fails, the channel application task status occasionally shows [4: Under Review (Platform)] instead of [3: Failed (Channel Publish)]. Checking the publish log table, 1 Douyin content item was sent to 5 Douyin accounts at the same time. Video uploads failed for 3 of these accounts. The channel application task IDs are: 159, 162, and 163.
Figure 1

2. Checking the channel application task table for the 3 records corresponding to channel application task IDs 159, 162, and 163, the expected status is [3: Failed (Channel Publish)]. However, the 3 records corresponding to channel application task IDs 162 and 163 have the status [4: Under Review (Platform)]. See Figure 2.

Checking the channel application task table for the 3 records corresponding to channel application task IDs 159, 162, and 163, the expected status is [3: Failed (Channel Publish)]. However, the 3 records corresponding to channel application task IDs 162 and 163 have the status [4: Under Review (Platform)].
Figure 2

3. Upon closely reviewing the code implementation, after a video upload fails, the channel application task status is updated to [3: Failed (Channel Publish)]. A record is then inserted into the publish log table, and the entire publish process concludes.

4. Finally, I decided to analyze the other channel application task IDs 160 and 161 under task ID 40. After the video upload for channel application task ID 160 succeeds, the create video operation is executed. Surprisingly, during this operation, when updating the status to 4, it updates based on the task ID rather than the channel application task ID. See Figure 3.

Finally, I decided to analyze the other channel application task IDs 160 and 161 under task ID 40. After the video upload for channel application task ID 160 succeeds, the create video operation is executed. Surprisingly, during this operation, when updating the status to 4, it updates based on the task ID rather than the channel application task ID.
Figure 3

5. The timeline of this Bug’s occurrence can be deduced as follows: After the video upload for channel application task ID 159 fails, its status is updated to [3: Failed (Channel Publish)]. After the video creation for channel application task ID 160 succeeds, the channel application task table statuses are batch-updated to [4: Under Review (Platform)] based on task ID 40. Then, when the video uploads for channel application task IDs 162 and 163 fail, their attempts to update the status to [3: Failed (Channel Publish)] fail, because the update condition requires the status to be [Publishing (Channel Publish)].

6. Checking the timestamp for the failed video upload of channel application task ID 159: 2021-07-15 11:35:11, which is earlier than the timestamp for the successful video creation of channel application task ID 160. See Figure 4.

Checking the timestamp for the failed video upload of channel application task ID 159: 2021-07-15 11:35:11, which is earlier than the timestamp for the successful video creation of channel application task ID 160.
Figure 4

7. Checking the timestamps for the failed video uploads of channel application task IDs 162 and 163: 2021-07-15 11:35:38 and 2021-07-15 11:35:48, which are later than the timestamp for the successful video creation of channel application task ID 160. See Figure 5.

Checking the timestamps for the failed video uploads of channel application task IDs 162 and 163: 2021-07-15 11:35:38 and 2021-07-15 11:35:48, which are later than the timestamp for the successful video creation of channel application task ID 160.
Figure 5

8. The timestamp for the successful video upload of channel application task ID 160 is 2021-07-15 11:34:57. There is no record of the timestamp for the successful video creation of channel application task ID 160, but it is definitely later than 2021-07-15 11:34:57. I plan to add the field item_created_at to the table cpa_douyin_video in the future. Comment: The creation time of the video content. See Figure 6.

The timestamp for the successful video upload of channel application task ID 160 is 2021-07-15 11:34:57. There is no record of the timestamp for the successful video creation of channel application task ID 160, but it is definitely later than 2021-07-15 11:34:57. I plan to add the field item_created_at to the table cpa_douyin_video in the future. Comment: The creation time of the video content.
Figure 6

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系