Clojure

When load-lib fails, a namespace is still created

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.3, Release 1.4
  • Fix Version/s: Release 1.5
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

When requiring a namespace that doesn't compile, a namespace is still created. The attached patch removes the namespace on failure if the namespace wasn't already present on entry to load-lib. See the test case in the patch for repro instructions.

This is obviously a subset of having atomic loads. Would a step further in this direction, e.g. using a swapable state object within clojure.lang.Namespace be of interest?

Activity

Rich Hickey made changes -
Field Original Value New Value
Fix Version/s Release 1.5 [ 10150 ]
Hide
Stuart Halloway added a comment -

Why catch Exception, not Throwable?

Show
Stuart Halloway added a comment - Why catch Exception, not Throwable?
Hide
Stuart Halloway added a comment -

This patch accomplishes its purpose, although (in the absence of fully atomic load) I would imagine it creates a race condition if one thread tried to load a broken namespace while another thread tried simply to create a namespace.

Marked screened anyway...

Show
Stuart Halloway added a comment - This patch accomplishes its purpose, although (in the absence of fully atomic load) I would imagine it creates a race condition if one thread tried to load a broken namespace while another thread tried simply to create a namespace. Marked screened anyway...
Stuart Halloway made changes -
Approval Screened [ 10004 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: