Skip to content

Longpolling: Does not survive random 502 from Telegram #44

@LeviSchuck

Description

@LeviSchuck

My bot did not resume polling after encountering a 502 from Telegram by longpolling.

Exception in thread "async-dispatch-18" clojure.lang.ExceptionInfo: clj-http: status 502 {:cached nil, :request-time 6929, :repeatable? false, :protocol-version {:name "HTTP", :major 1, :minor 1}, :streaming? true, :http-client #object[org.apache.http.impl.client.InternalHttpClient 0x6e992d0a "org.apache.http.impl.client.InternalHttpClient@6e992d0a"], :chunked? false, :type :clj-http.client/unexceptional-status, :reason-phrase "Bad Gateway", :headers {"Server" "nginx/1.12.2", "Date" "Sun, 28 Oct 2018 01:16:34 GMT", "Content-Type" "application/json", "Content-Length" "57", "Connection" "close", "Access-Control-Allow-Origin" "*", "Access-Control-Expose-Headers" "Content-Length,Content-Type,Date,Server,Connection"}, :orig-content-encoding nil, :status 502, :length 57, :body "{\"ok\":false,\"error_code\":502,\"description\":\"Bad Gateway\"}", :trace-redirects []}
	at slingshot.support$stack_trace.invoke(support.clj:201)
	at clj_http.client$exceptions_response.invokeStatic(client.clj:245)
	at clj_http.client$exceptions_response.invoke(client.clj:236)
	at clj_http.client$wrap_exceptions$fn__10385.invoke(client.clj:254)
	at clj_http.client$wrap_accept$fn__10627.invoke(client.clj:737)
	at clj_http.client$wrap_accept_encoding$fn__10634.invoke(client.clj:759)
	at clj_http.client$wrap_content_type$fn__10621.invoke(client.clj:720)
	at clj_http.client$wrap_form_params$fn__10724.invoke(client.clj:961)
	at clj_http.client$wrap_nested_params$fn__10741.invoke(client.clj:995)
	at clj_http.client$wrap_flatten_nested_params$fn__10750.invoke(client.clj:1019)
	at clj_http.client$wrap_method$fn__10682.invoke(client.clj:895)
	at clj_http.cookies$wrap_cookies$fn__7853.invoke(cookies.clj:131)
	at clj_http.links$wrap_links$fn__9284.invoke(links.clj:63)
	at clj_http.client$wrap_unknown_host$fn__10758.invoke(client.clj:1048)
	at clj_http.client$request_STAR_.invokeStatic(client.clj:1176)
	at clj_http.client$request_STAR_.invoke(client.clj:1169)
	at clj_http.client$get.invokeStatic(client.clj:1182)
	at clj_http.client$get.doInvoke(client.clj:1178)
	at clojure.lang.RestFn.invoke(RestFn.java:423)
	at morse.api$get_updates.invokeStatic(api.clj:17)
	at morse.api$get_updates.invoke(api.clj:10)

Would recommend retrying a connection every 10-30 seconds as longpolling sessions may be arbitrarily resumed later

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions