Author: psmith Date: Sat Feb 10 20:11:03 2007 New Revision: 84
Modified: branches/home/psmith/restructure/src/event/epoll.lisp branches/home/psmith/restructure/src/io/async-fd.lisp branches/home/psmith/restructure/src/io/nio-server.lisp branches/home/psmith/restructure/src/nio-logger/nio-logger.lisp branches/home/psmith/restructure/src/nio-logger/run-logging-client.lisp branches/home/psmith/restructure/src/nio-logger/run-logging-server.lisp branches/home/psmith/restructure/src/protocol/yarpc/yarpc-client-state-machine.lisp branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp branches/home/psmith/restructure/src/statemachine/state-machine.lisp Log: cleanup of debug msgs
Modified: branches/home/psmith/restructure/src/event/epoll.lisp ============================================================================== --- branches/home/psmith/restructure/src/event/epoll.lisp (original) +++ branches/home/psmith/restructure/src/event/epoll.lisp Sat Feb 10 20:11:03 2007 @@ -84,10 +84,12 @@ (case res (-1 (let ((errno (get-errno))) - (format t "-1 returned from epoll-wait, errno ~A~%" errno) (if (eql errno 4) ;EINTR - interrupted by a system call - (return nil) - (error 'poll-error)))) + (return nil) + (progn + (format t "-1 returned from epoll-wait, errno:") + (perror) + (error 'poll-error))))) (return nil) (t (let ((idents nil))
Modified: branches/home/psmith/restructure/src/io/async-fd.lisp ============================================================================== --- branches/home/psmith/restructure/src/io/async-fd.lisp (original) +++ branches/home/psmith/restructure/src/io/async-fd.lisp Sat Feb 10 20:11:03 2007 @@ -123,7 +123,7 @@
(defun write-more (async-fd) "Write data from ASYNC-FD's write bytebuffer" - (format-log t "async-fd:write-more - called with ~A~%" async-fd) +#+nio-debug (format-log t "async-fd:write-more - called with ~A~%" async-fd) (with-slots (write-fd foreign-write-buffer close-pending) async-fd #+nio-debug (format t "async-fd:write-more - foreign-write-buffer b4 flip ~A~%" foreign-write-buffer) (nio-buffer:flip foreign-write-buffer)
Modified: branches/home/psmith/restructure/src/io/nio-server.lisp ============================================================================== --- branches/home/psmith/restructure/src/io/nio-server.lisp (original) +++ branches/home/psmith/restructure/src/io/nio-server.lisp Sat Feb 10 20:11:03 2007 @@ -134,7 +134,7 @@ ;; socket i/o available (t (let ((async-fd (gethash fd client-hash))) - (format-log t "IO event ~A on ~A~%" event async-fd) +#+nio-debug (format-log t "nio-server::start-server - IO event ~A on ~A~%" event async-fd) (unless (null async-fd) (catch 'error-exit (handler-bind ((read-error #'(lambda (x)
Modified: branches/home/psmith/restructure/src/nio-logger/nio-logger.lisp ============================================================================== --- branches/home/psmith/restructure/src/nio-logger/nio-logger.lisp (original) +++ branches/home/psmith/restructure/src/nio-logger/nio-logger.lisp Sat Feb 10 20:11:03 2007 @@ -42,7 +42,8 @@
(defun callback(result) - (nio-utils:format-log t "Result of remote-log ~A~%" result)) +#+nio-debug (nio-utils:format-log t "Result of remote-log ~A~%" result) +)
;;Tail the given log and write to remote logger @@ -52,9 +53,9 @@ (nio:add-connection (nio:node ip-address 16323)) (with-line-from-tailed-file (text filename 1) (let ((rpc (format nil "(nio-logger:remote-log "~A")" (cl-base64:string-to-base64-string text)))) - (nio-utils:format-log t "Toplevel Submitting job~A~%" rpc) +#+nio-debug (nio-utils:format-log t "nio-logger::tail-log Submitting job~A~%" rpc) (nio:with-connected-nodes (node) - (nio-utils:format-log t "Toplevel sending ~A to ~A~%" rpc node) +#+nio-debug (nio-utils:format-log t "Toplevel sending ~A to ~A~%" rpc node) (nio-yarpc:remote-execute (nio:active-conn node) rpc #'callback)))))
;Runs a multithreaded system with an IO thread dealing with IO only and a 'job' thread taking and executing jobs
Modified: branches/home/psmith/restructure/src/nio-logger/run-logging-client.lisp ============================================================================== --- branches/home/psmith/restructure/src/nio-logger/run-logging-client.lisp (original) +++ branches/home/psmith/restructure/src/nio-logger/run-logging-client.lisp Sat Feb 10 20:11:03 2007 @@ -25,7 +25,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |#
-(push :nio-debug *features*) +;(push :nio-debug *features*) (require :asdf) (require :nio-logger)
Modified: branches/home/psmith/restructure/src/nio-logger/run-logging-server.lisp ============================================================================== --- branches/home/psmith/restructure/src/nio-logger/run-logging-server.lisp (original) +++ branches/home/psmith/restructure/src/nio-logger/run-logging-server.lisp Sat Feb 10 20:11:03 2007 @@ -25,7 +25,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |#
-(push :nio-debug *features*) +;(push :nio-debug *features*) (require :asdf) (require :nio-logger)
Modified: branches/home/psmith/restructure/src/protocol/yarpc/yarpc-client-state-machine.lisp ============================================================================== --- branches/home/psmith/restructure/src/protocol/yarpc/yarpc-client-state-machine.lisp (original) +++ branches/home/psmith/restructure/src/protocol/yarpc/yarpc-client-state-machine.lisp Sat Feb 10 20:11:03 2007 @@ -76,22 +76,22 @@ #+nio-debug (format-log t "yarpc-client-state-machine:process-outgoing-packet called, polling the job-queue ~%") (let ((ttd (nio-compat:take (job-queue sm) :blocking-call nil))) (when ttd - (format-log t "yarpc-client-state-machine:process-outgoing-packet got job ~A ~%" ttd) +#+nio-debug (format-log t "yarpc-client-state-machine:process-outgoing-packet got job ~A ~%" ttd) (destructuring-bind (job call-string) ttd (setf (gethash (incf +request-id+) (request-map sm)) job) (make-instance 'call-method-packet :call-string call-string :request-id +request-id+)))))
(defmethod process-incoming-packet ((sm yarpc-client-state-machine) (response method-response-packet)) - (format-log t "yarpc-client-state-machine:process-incoming-packet called :sm ~A :packet ~A~%" sm response) +#+nio-debug (format-log t "yarpc-client-state-machine:process-incoming-packet called :sm ~A :packet ~A~%" sm response) (let* ((*package* (find-package :nio-yarpc)) (result (read-from-string (response response))) (request-id (request-id response))) - (format-log t "yarpc-client-state-machine:process-incoming-packet :result ~A :request-id ~A~%" result request-id) - (maphash #'(lambda (k v) (format t "~a -> ~a~%" k v)) (request-map sm)) +#+nio-debug (format-log t "yarpc-client-state-machine:process-incoming-packet :result ~A :request-id ~A~%" result request-id) +; (maphash #'(lambda (k v) (format t "~a -> ~a~%" k v)) (request-map sm)) (let ((remote-job (gethash request-id (request-map sm)))) (funcall (callback remote-job) result))))
;Execute the call-string on the remote node and call callback with the result (defmethod remote-execute ((sm yarpc-client-state-machine) call-string callback) - (format-log t "yarpc-client-state-machine:remote-execute called :sm ~A :call-string ~A :callback ~A~%" sm call-string callback) +#+nio-debug (format-log t "yarpc-client-state-machine:remote-execute called :sm ~A :call-string ~A :callback ~A~%" sm call-string callback) (nio-compat:add (job-queue sm) (list (remote-job callback) call-string)))
Modified: branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp ============================================================================== --- branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp (original) +++ branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp Sat Feb 10 20:11:03 2007 @@ -53,8 +53,12 @@ (if (<= (- packet-length +yarpc-packet-header-size+) (remaining buf)) ;is the whole packet available in the buffer? (let* ((packet-request-id (bytebuffer-read-32 buf)) (ret-packet (ecase packet-id - (0 (progn (format-log t "yarpc-packet-factory:get-packet - got CALL-METHOD-PACKET-ID~%") (call-method-packet (bytebuffer-read-string buf (- packet-length +yarpc-packet-header-size+ +PACKET-REQUEST-ID-SIZE+)) :request-id packet-request-id))) - (1 (progn (format-log t "yarpc-packet-factory:get-packet - got METHOD-RESPONSE-PACKET-ID~%") (method-response-packet (bytebuffer-read-string buf (- packet-length +yarpc-packet-header-size+ +PACKET-REQUEST-ID-SIZE+)) :request-id packet-request-id)))))) + (0 (progn +#+nio-debug (format-log t "yarpc-packet-factory:get-packet - got CALL-METHOD-PACKET-ID~%") + (call-method-packet (bytebuffer-read-string buf (- packet-length +yarpc-packet-header-size+ +PACKET-REQUEST-ID-SIZE+)) :request-id packet-request-id))) + (1 (progn +#+nio-debug (format-log t "yarpc-packet-factory:get-packet - got METHOD-RESPONSE-PACKET-ID~%") + (method-response-packet (bytebuffer-read-string buf (- packet-length +yarpc-packet-header-size+ +PACKET-REQUEST-ID-SIZE+)) :request-id packet-request-id)))))) (compact buf) #+nio-debug (format-log t "yarpc-packet-factory:get-packet - after compact ~%~A~%" buf) #+nio-debug (format-log t "yarpc-packet-factory:get-packet - retuirning packet ~A~%" ret-packet)
Modified: branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp ============================================================================== --- branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp (original) +++ branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp Sat Feb 10 20:11:03 2007 @@ -59,25 +59,25 @@
(defun run-job(&key (blocking t)) - (format-log t "yarpc-state-machine:run-job - Server toplevel waiting for job~%") +#+nio-debug (format-log t "yarpc-state-machine:run-job - Server toplevel waiting for job~%") (let ((server-job (nio-compat:take nio-yarpc:job-queue :blocking-call blocking))) (when server-job (destructuring-bind (job request-id result-queue) server-job - (format-log t "yarpc-state-machine:run-job - Server received job ~A~%" job) +#+nio-debug (format-log t "yarpc-state-machine:run-job - Server received job ~A~%" job) (nio-compat:add result-queue (list request-id (nio-yarpc:execute-call job)))))))
(defmethod process-outgoing-packet((sm yarpc-state-machine)) - (format-log t "yarpc-state-machine:process-outgoing-packet - called, polling the results-queue ~%" ) +#+nio-debug (format-log t "yarpc-state-machine:process-outgoing-packet - called, polling the results-queue ~%" ) (let ((server-job (nio-compat:take (result-queue sm) :blocking-call nil))) (when server-job (destructuring-bind (request-id result) server-job - (format-log t "yarpc-state-machine:process-outgoing-packet - got :request-id ~A result ~A ~%" request-id result) +#+nio-debug (format-log t "yarpc-state-machine:process-outgoing-packet - got :request-id ~A result ~A ~%" request-id result) (method-response-packet result :request-id request-id)))))
;Process a call method packet by placing it in the job-queue (defmethod process-incoming-packet ((sm yarpc-state-machine) (call call-method-packet)) - (format-log t "yarpc-state-machine:process-incoming-packet - called :sm ~A :packet ~A~%" sm call) +#+nio-debug (format-log t "yarpc-state-machine:process-incoming-packet - called :sm ~A :packet ~A~%" sm call) (nio-compat:add job-queue (list (call-string call) (request-id call) (result-queue sm))) (when +process-jobs-inline+ (run-job :blocking nil)))
@@ -107,7 +107,7 @@ (handler-case (let* ((rpc-call-list (read-from-string call-string )) (fn (member (symbol-function (first rpc-call-list)) *remote-fns* ))) - (format-log t "yarpc-state-machine:execute-call - fn ~A authorised? : ~A~%" (symbol-function (first rpc-call-list)) fn) +#+nio-debug (format-log t "yarpc-state-machine:execute-call - fn ~A authorised? : ~A~%" (symbol-function (first rpc-call-list)) fn) (if fn (apply (first rpc-call-list) (rest rpc-call-list)) (error 'authorization-error)))
Modified: branches/home/psmith/restructure/src/statemachine/state-machine.lisp ============================================================================== --- branches/home/psmith/restructure/src/statemachine/state-machine.lisp (original) +++ branches/home/psmith/restructure/src/statemachine/state-machine.lisp Sat Feb 10 20:11:03 2007 @@ -61,7 +61,9 @@ (get-packet (get-packet-factory sm) foreign-read-buffer) (buffer-too-small-error (read-err) (if (recommend-buffer-size sm :read (recommended-size read-err)) + (progn (format-log t "resized incomming buffer ~A~%"foreign-read-buffer) + nil) (error 'not-implemented-yet-read-resize-failure)))))) (format-log t "state-machine::process-read - incoming packet: ~A~%" incoming-packet) (when incoming-packet