http - 芭蕾舞 Actor : Idle timeout triggered before initiating inbound response

标签 http ballerina

我正在芭蕾舞项目中执行任务预约,该项目每 10 分钟运行一次。它在大约一个小时内运行良好,但当执行时间达到 2 小时时,它会给我一个错误。以下是错误日志。

2018-10-04 12:00:00,002 INFO - Scanning the Github repository
2018-10-04 12:01:00,008 ERROR - Idle timeout triggered before initiating inbound response : {message:"Idle timeout triggered before initiating inbound response", cause:null, statusCode:0}

从错误日志看来空闲时间是1分钟。

这是程序代码。

public function main(string... args) {

        log:printInfo("------ Scheduling Appointments --------------");   

        (function() returns error?) onTriggerFunction = gitHubTaskExecute;
        (function(error)) onErrorFunction = gitGubTaskError;

        gitGubTask = new task:Appointment(onTriggerFunction, 
                                            onErrorFunction, 
                                            "0 30 1 * * ?");

        gitGubTask.schedule();
    }
}

@Description { value:"Execute the Github repository scanning task"}
function gitHubTaskExecute() returns (error?) {
    log:printInfo("Scanning the Github repository : " + repository);
    executedTaskCount = executedTaskCount + 1;
    if (executedTaskCount == 100) {
        log:printInfo("Stopping Appointment#1 cleanup task since it
                       has run 100 times");

        gitGubTask.cancel();
    }
    return cleanup();
}

@Description { value:"Execute the task cleanup"}
function cleanup() returns (error?) {
    //Call function here

    return ();
}

知道是什么触发了这个错误吗?我想实现一项应该每天执行的任务。

最佳答案

请注意,当连接空闲时间超过指定时间时,IdleTimeout 就会触发。然后服务器/客户端将通过适当的响应关闭连接。如果您想禁用它,可以将其设置为 >= 0

示例客户端端点:

endpoint http:Client clientEndpoint {
    url: "http://localhost:9090",
    timeoutMillis: 300000
};

http 客户端和服务器端点中有一个名为 timeoutInMillis 的配置。如果需要,您可以增加该值。

关于http - 芭蕾舞 Actor : Idle timeout triggered before initiating inbound response,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52640934/

相关文章:

database - Ballerina 中事务失败时如何回滚缓存插入操作

ballerina - 删除字符串数组中的重复值?

mysql - 在 Ballerina 中参数化 MySQL 查询的顺序列名称和排序顺序

silverlight - Http 托管 silverlight 应用跨域访问 https 托管服务

http - 如何使用 TIdHttp GET 请求发送内容?

python - 运行一个小型 HTTP 服务器来检查回调

Ballerina native 客户端连接器

http - HTTP 代理是否应该将 Content-Encoding header 复制回客户端?

http - 使用 HTTP POST 时在 URL 中传递参数

ballerina - 资源方法调用中路径参数未解析