     dbg: (method) =>
         (m) => winston.debug("ProjectClient(#{@project_id},#{@host}).#{method}: #{m}")
 
+    clear_state: () =>
+        @dbg("clear_state")()
+        delete @_state
+        delete @_state_time
+        delete @_state_set_by
+
     update_host: (opts) =>
         opts = defaults opts,
             cb : required
-        host = undefined
+        host          = undefined
         previous_host = @host
         dbg = @dbg("update_host")
         t = misc.mswalltime()

            cb             : required
        @project_id = opts.project_id
        @compute_server = opts.compute_server
        @_state = undefined
        @_state_time = undefined
        dbg = @dbg('constructor')
        dbg("getting project's host")
        @update_host

        ], (err) =>
            if not err
                @host = host
                dbg("henceforth using host=#{@host}")
                if host != previous_host
                    @clear_state()
                    dbg("HOST CHANGE: #{previous_host} --> #{host}")
            dbg("time=#{misc.mswalltime(t)}ms")
            opts.cb(err, host)
        )
