Grails
  1. Grails
  2. GRAILS-8539

Creating of vim swp files impacting reloading

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0 final
    • Fix Version/s: 2.0.1
    • Component/s: None
    • Environment:
      Debian unstable, Java Sun 1.6.0_26-b03

      Description

      class MyDomain { static myMethod()

      {'myMethod'}

      }
      class MyController { def index()

      {render MyDomain.myMethod()}

      }

      Try to change MyDomain.myMethod return value and refresh your index page.

        Activity

        Hide
        Graeme Rocher added a comment -

        Use a different editor for the moment. Textmate doesn't create swp files.

        Show
        Graeme Rocher added a comment - Use a different editor for the moment. Textmate doesn't create swp files.
        Hide
        Rodrigo Rosenfeld Rosas added a comment -

        Textmate doesn't run on Linux. But this is no problem, as I've just disabled the swap files for now in gVim. But I'd like to be able to re-enable them some day when this gets fixed.

        Show
        Rodrigo Rosenfeld Rosas added a comment - Textmate doesn't run on Linux. But this is no problem, as I've just disabled the swap files for now in gVim. But I'd like to be able to re-enable them some day when this gets fixed.
        Hide
        Peter Ledbrook added a comment -

        This is reproducible with vim, and pretty frustrating. More importantly, it could be a more pervasive problem. Anyway, to reproduce with vim:

        1. Unpack the attach bug report
        2. Start up interactive mode
        3. Execute run-app
        4. exit
        5. Execute run-app a second time
        6. Open the application in a browser
        7. Try http://localhost:8080/library/book/hello (not implemented yet)
        8. Now edit BookController.groovy in vim and add

        def hello() {
            render "Hello world!"
        }
        

        9. Save
        10. Refresh the browser.

        You should find that BookController has not been reloaded, although there are no error messages.

        Show
        Peter Ledbrook added a comment - This is reproducible with vim, and pretty frustrating. More importantly, it could be a more pervasive problem. Anyway, to reproduce with vim: 1. Unpack the attach bug report 2. Start up interactive mode 3. Execute run-app 4. exit 5. Execute run-app a second time 6. Open the application in a browser 7. Try http://localhost:8080/library/book/hello (not implemented yet) 8. Now edit BookController.groovy in vim and add def hello() { render "Hello world!" } 9. Save 10. Refresh the browser. You should find that BookController has not been reloaded, although there are no error messages.
        Hide
        Graeme Rocher added a comment -

        I have pushed a potential fix, but because i was unable to see Grails monitoring any SWP files whilst debugging nor was I able to reproduce an exceptions or errors I would like someone to verify.

        Using Peter's steps I was unable to reproduce any reloading failures with MacVim and :set swapfile

        Show
        Graeme Rocher added a comment - I have pushed a potential fix, but because i was unable to see Grails monitoring any SWP files whilst debugging nor was I able to reproduce an exceptions or errors I would like someone to verify. Using Peter's steps I was unable to reproduce any reloading failures with MacVim and :set swapfile
        Hide
        Rodrigo Rosenfeld Rosas added a comment -

        I've made some changes on current Grails 2.0.1 with the swapfiles enabled and I didn't get any further issues with regards to reloading of classes, so I think this bug was really fixed. Thanks!

        Unfortunately I can't upgrade to 2.0.1 yet because it broke both mongo and mongo-morphia plugins and I don't know any other plugin for Grails for writing to Mongo, so I'll have to implement my logging to mongo in Groovy by myself before I'm able to upgrade to 2.0.1...

        Show
        Rodrigo Rosenfeld Rosas added a comment - I've made some changes on current Grails 2.0.1 with the swapfiles enabled and I didn't get any further issues with regards to reloading of classes, so I think this bug was really fixed. Thanks! Unfortunately I can't upgrade to 2.0.1 yet because it broke both mongo and mongo-morphia plugins and I don't know any other plugin for Grails for writing to Mongo, so I'll have to implement my logging to mongo in Groovy by myself before I'm able to upgrade to 2.0.1...

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Rodrigo Rosenfeld Rosas
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Last Reviewed:

              Development