nicferrier / emacs-web

a useful HTTP client in EmacsLisp
GNU General Public License v3.0
76 stars 8 forks source link

web/http-post-sentinel unexpected evt: killed: 9 #13

Open AshtonKem opened 11 years ago

AshtonKem commented 11 years ago

The following call in Butler constantly causes the above message.

(defun get-jobs (server buffer callback)
  (lexical-let* ((url-request-method "GET")
                 (args (cdr (cdr server)))
                 (url (cdr (assoc 'server-address args)))
                 (headers
      `(("Authorization" . ,(auth-string server)))))
    (web-http-get (lambda (httpc header data)
                    (update-butler-status data buffer callback))
                  :url (concat
                        url
                        "/api/json?tree=jobs[name,color,url,lastBuild[building,duration,estimatedDuration,timestamp]]")
                  :extra-headers headers)))

I can't quite figure out why this is happening. Another (simpler) call I make through the same method does not cause the message to be displayed.

web.el version 0.3.7

nicferrier commented 11 years ago

The immediate thing that grabs me is that lexical-let isn't lexical scope.

Instead turn on lexical-binding properly. Test like that and then let me know if it's still broken?

AshtonKem commented 11 years ago

Replacing lexical-let with let + lexical-binding does not appear to resolve the issue. I'm going to clean up the code a bit and see if I can produce a cleaner example.

nicferrier commented 11 years ago

I'm less than enthusiastic about replacing a lot of state to see the error. Can you do the job of replicating the state for me somehow? packet trace (don't forget to edit the passwords out) or tell me how I can get this erroring? (I need to setup jenkins?)

AshtonKem commented 11 years ago

I'm hoping that it's not Jenkins specific. I have two different call outs to Jenkins, one to retrieve a list of jobs, one to trigger builds. This one works fine:

(web-http-get (lambda (conn headers data))
                        :url url
                        :extra-headers `(("Authorization" . ,auth)))

I'll turn on debugging to see what's what and report back to you.

nicferrier commented 11 years ago

I don't think I've tried basic auth before. Perhaps we should knock up an elnode test for this and see if web can handle it?

AshtonKem commented 11 years ago

I can't seem to figure out what's going on here. A more basic web-http-get (with basic auth) and a more or less empty callback works just file. The one that does more heavy processing though appears to cause it consistently.

nicferrier commented 11 years ago

So, to fix this we need some server that can do auth? and then we can try various processing to see what happens.

Let me try and make some elnode to test it and check it in.

Sorry this has take me so long to respond.