Skip to content

1.20.0

Latest

Choose a tag to compare

@github-actions github-actions released this 04 Dec 13:55
· 1 commit to development since this release
3edfd91
  • BL-2841 Retry for the bx:http component and the http() BIF. withRetry( 3 ) retries a request up to 3 times, and withRetry( { times, delay, on, backoff, maxDelay, when, onRetry } ) sets every option in one struct. Both mix with withRetryDelay(), withRetryOn(), withRetryBackoff(), withRetryMaxDelay(), withRetryWhen() and onRetry(), and the last call wins per setting. The component has the matching retry, retryDelay, retryOn, retryBackoff, retryMaxDelay, retryWhen and onRetry attributes. By default a request is retried on 408, 429, 502, 503 and 504 (timeouts are reported as 408 and connection failures as 502), waiting 1 second, with fixed or exponential backoff capped by maxDelay (60 seconds). A Retry-After header (seconds or an HTTP date) sets the wait, and if it is longer than maxDelay retrying stops and that response is returned. retryWhen( httpResult ) can retry on other conditions. onError, onComplete and throwOnError apply to the final result only, the result has a retryCount key, and a streaming request is not retried once a chunk callback has fired. Retry is off unless a retry count is set
  • BL-2820 Symbolic link support. New BIFs fileCreateSymlink( link, target, overwrite ), fileIsSymlink( path ) and fileReadSymlink( path, resolve ). fileInfo() and getFileInfo() return isLink and linkTarget, and the directoryList() query has isLink and linkTarget columns. directoryList(), directoryCopy() and directoryDelete() (and bx:directory) gain a followLinks argument that defaults to false. Behavior change: directoryDelete( path, true ) no longer follows symbolic links, so it no longer empties the folders they point to (a link is removed as a link). directoryCopy() now copies links as links instead of copying their content or creating an empty folder
  • Scheduled tasks can now run once across a cluster of BoxLang servers instead of on every server. A task that opts in (cluster: true, or onOneServer()) coordinates through a cache backed by a store every node can see, so a scheduled run normally happens on one node, work is spread across the nodes, and a node that goes down has its work picked up by the others. Coordination is best effort, not a hard guarantee: the cache offers no atomic create, so a contender paused between reading and writing its claim can overwrite a claim another node has already started. In that narrow window an occurrence can run twice. Duplicate detection reports it, but it cannot undo the side effects, so clustered jobs should be idempotent. New top-level cluster block in boxlang.json (enabled, nodeId, name, cacheName, heartbeatSeconds); whether this node is in a cluster is separate from whether tasks cluster, so scheduler.clusterTasks (default true) is the deployment default a task with no cluster flag inherits - set it to false on a clustered node to keep every task local unless it opts in - and scheduler.clusterMode selects eager (first writer wins) or balanced (busier nodes wait longer, ranked by a rolling task-seconds window). Clustered tasks whose period is too short to complete a claim are rejected at startup with an actionable message rather than running late or twice. Each occurrence gets its own cache record, so one occurrence can never overwrite another's claim. A run ended by its own node's shutdown is recorded interrupted; a run whose node disappeared is reported abandoned by a peer. Every node keeps a full track record of every clustered run in its scheduler.log, with a peer-observation thread reporting started and terminal states for all nodes. Breaking: a task marked as clustered now refuses to start when clustering is not enabled on that node, instead of silently running on every node; scheduler.cacheName is deprecated but still honoured as an upgrade bridge (the old "default" value is ignored so upgrading does not switch clustering on)
  • BL-2809 systemExecute() gains three optional arguments for interactive CLI jobs. onLine( line, stream ) is called on the calling thread as each output line arrives, before the process exits, with stream set to "stdout" or "stderr", and output is still captured in the result. isCancelled() is polled while the process runs and, when it returns true, terminates the process tree and returns the output captured so far with cancelled = true (and terminated = true), distinct from a timeout. mergeErrors = true folds stderr into stdout for a single live log. Streams are read character by character so a line that stalls before its newline is still captured. The result struct gains a cancelled key. Existing calls behave the same when the new arguments are omitted
  • BL-2808 Struct.putIfAbsent is now atomic and follows the Map contract: it returns the existing value when the key is present (it used to return null) and null only when the key was absent. Change listeners fire only for the call that inserts. structInsert( struct, key, value, false ) now claims the key atomically, so concurrent callers can no longer both succeed. Adds IStruct.tryPutIfAbsent, and StructMapWrapper.putIfAbsent now returns the existing value too
  • BL-2717 Queries with more than 1,048,576 rows no longer lose rows or throw a NullPointerException when read. ChunkedArrayList.trimToSize() released top-level chunks that still held live rows once a list had grown past its first layer of chunks, which chunked query storage reaches at 1,048,576 rows with the default chunk size
  • Cron scheduled tasks no longer silently skip a day when a tick runs late, e.g. when it is queued behind other tasks on a saturated scheduler executor. A tick now fires if a cron time was due since the previous check, runs late rather than never, and logs a warning (with a thread-count hint when the executor is saturated). Scheduled task constraints (weekdays, day of the week or month, first/last business day, time windows, start/end dates) are now judged against the time a tick was due, so a late tick is not skipped by crossing midnight. Scheduler executors are now sized from the threads of the executor named by scheduler.executor in boxlang.json (they were always 10), and the documented threads property of executors entries is now honored. Also fixes exclude replacing the cron gate on bx:schedule tasks that set both cronTime and exclude
  • BL-2840 boxlang format fixes, found by formatting a real module (cborm) with its cfformat rules converted by --convertConfig. Code changes the formatter no longer makes: a variable as a script component attribute (transaction datasource=dsn) was written as the string "dsn"; a quoted named-argument key that is not an identifier ("strategy-outputDir" = x) lost its quotes and no longer compiled; a CF script component such as setting became cfsetting, which the next pass split into two statements; a comment before else moved after it and the next pass read an empty else; comments inside call arguments, closures passed to methods and chained calls were dropped or moved; a banner /* *** comment became a doc comment; a & "/#b#" was merged into one interpolated string. Stable output: a second pass no longer changes the result (blank lines before trailing comments, spaces after template comments, alignment). Settings honored: cfFormatCompatibility in a .bxformat.json is now read; cfformat's element_count/min_length rules for arguments, parameters, arrays and structs, measured as printed; alignment of consecutive assignments; comparison_style: preserve keeps eq, AND, NOT and && as written; compact function(){ for closures; new class.metadata multiline setting for component header attributes (converted from cfformat's metadata.multiline); parentheses padding in catch. Layout: closures passed to a call hug its parentheses; chains split by method calls, or when a call in the chain spans lines; expressions and quotes inside #...# are kept as written; block, doc and template comments keep their text and inner indentation; the same class body spacing for .cfc and .bx
  • BL-2840 In BoxLang script, else followed by a comment (} else // note or } else /* note */ {) was read as a variable named else. A chained method name's source position now ends on its own line instead of the call's last line