AsyncPostgresSaver - unsupported Unicode escape sequence

Checked other resources

[X] I added a very descriptive title to this issue.
[X] I searched the LangGraph/LangChain documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I am sure that this is a bug in LangGraph/LangChain rather than my code.
[X] I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.

Example Code
from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver
from langgraph.prebuilt import create_react_agent

from typing import Literal

from langchain_core.tools import tool
from langchain_openai import ChatOpenAI

@tool
def get_weather(city: Literal["nyc", "sf"]):
    """Use this to get weather information."""
    if city == "nyc":
        return "It might be cloudy in nyc"
    elif city == "sf":
        return "It's always sunny in sf"
    else:
        raise AssertionError("Unknown city")

tools = [get_weather]
model = ChatOpenAI(model_name="gpt-4o-mini")

async with AsyncPostgresSaver.from_conn_string(DB_URI) as checkpointer:
    graph = create_react_agent(model, tools=tools, checkpointer=checkpointer)
    config = {"configurable": {"thread_id": "6"}}
    res = await graph.ainvoke(
        {"messages": [("human", "what's the \x00 weather in nyc")]}, config
    )
    checkpoint_tuples = [c async for c in checkpointer.alist(config)]

Error Message and Stack Trace (if applicable)
UntranslatableCharacter                   Traceback (most recent call last)
Cell In[15], line 4
      2 graph = create_react_agent(model, tools=tools, checkpointer=checkpointer)
      3 config = {"configurable": {"thread_id": "6"}}
----> 4 res = await graph.ainvoke(
      5     {"messages": [("human", "what's the \x00 weather in nyc")]}, config
      6 )
      7 checkpoint_tuples = [c async for c in checkpointer.alist(config)]

File /venv/lib/python3.12/site-packages/langgraph/pregel/__init__.py:1592, in Pregel.ainvoke(self, input, config, stream_mode, output_keys, interrupt_before, interrupt_after, debug, **kwargs)
   1590 else:
   1591     chunks = []
-> 1592 async for chunk in self.astream(
   1593     input,
   1594     config,
   1595     stream_mode=stream_mode,
   1596     output_keys=output_keys,
   1597     interrupt_before=interrupt_before,
   1598     interrupt_after=interrupt_after,
   1599     debug=debug,
   1600     **kwargs,
   1601 ):
   1602     if stream_mode == "values":
   1603         latest = chunk

File /venv/lib/python3.12/site-packages/langgraph/pregel/__init__.py:1443, in Pregel.astream(self, input, config, stream_mode, output_keys, interrupt_before, interrupt_after, debug, subgraphs)
   1439 if "custom" in stream_modes:
   1440     config[CONF][CONFIG_KEY_STREAM_WRITER] = lambda c: stream.put_nowait(
   1441         ((), "custom", c)
   1442     )
-> 1443 async with AsyncPregelLoop(
   1444     input,
   1445     stream=StreamProtocol(stream.put_nowait, stream_modes),
   1446     config=config,
   1447     store=self.store,
   1448     checkpointer=checkpointer,
   1449     nodes=self.nodes,
   1450     specs=self.channels,
   1451     output_keys=output_keys,
   1452     stream_keys=self.stream_channels_asis,
   1453 ) as loop:
   1454     # create runner
   1455     runner = PregelRunner(
   1456         submit=loop.submit,
   1457         put_writes=loop.put_writes,
   1458         use_astream=do_stream is not None,
   1459     )
   1460     # enable subgraph streaming

File /venv/lib/python3.12/site-packages/langgraph/pregel/loop.py:883, in AsyncPregelLoop.__aexit__(self, exc_type, exc_value, traceback)
    876 async def __aexit__(
    877     self,
    878     exc_type: Optional[Type[BaseException]],
   (...)
    881 ) -> Optional[bool]:
    882     # unwind stack
--> 883     return await asyncio.shield(
    884         self.stack.__aexit__(exc_type, exc_value, traceback)
    885     )

File /usr/local/lib/python3.12/contextlib.py:754, in AsyncExitStack.__aexit__(self, *exc_details)
    750 try:
    751     # bare "raise exc_details[1]" replaces our carefully
    752     # set-up context
    753     fixed_ctx = exc_details[1].__context__
--> 754     raise exc_details[1]
    755 except BaseException:
    756     exc_details[1].__context__ = fixed_ctx

File /usr/local/lib/python3.12/contextlib.py:737, in AsyncExitStack.__aexit__(self, *exc_details)
    735     cb_suppress = cb(*exc_details)
    736 else:
--> 737     cb_suppress = await cb(*exc_details)
    739 if cb_suppress:
    740     suppressed_exc = True

File /venv/lib/python3.12/site-packages/langgraph/pregel/executor.py:179, in AsyncBackgroundExecutor.__aexit__(self, exc_type, exc_value, traceback)
    177 try:
    178     if exc := task.exception():
--> 179         raise exc
    180 except asyncio.CancelledError:
    181     pass

File /venv/lib/python3.12/site-packages/langgraph/pregel/loop.py:806, in AsyncPregelLoop._checkpointer_put_after_previous(self, prev, config, checkpoint, metadata, new_versions)
    804 try:
    805     if prev is not None:
--> 806         await prev
    807 finally:
    808     await cast(BaseCheckpointSaver, self.checkpointer).aput(
    809         config, checkpoint, metadata, new_versions
    810     )

File /venv/lib/python3.12/site-packages/langgraph/pregel/loop.py:806, in AsyncPregelLoop._checkpointer_put_after_previous(self, prev, config, checkpoint, metadata, new_versions)
    804 try:
    805     if prev is not None:
--> 806         await prev
    807 finally:
    808     await cast(BaseCheckpointSaver, self.checkpointer).aput(
    809         config, checkpoint, metadata, new_versions
    810     )

    [... skipping similar frames: AsyncPregelLoop._checkpointer_put_after_previous at line 806 (1 times)]

File /venv/lib/python3.12/site-packages/langgraph/pregel/loop.py:806, in AsyncPregelLoop._checkpointer_put_after_previous(self, prev, config, checkpoint, metadata, new_versions)
    804 try:
    805     if prev is not None:
--> 806         await prev
    807 finally:
    808     await cast(BaseCheckpointSaver, self.checkpointer).aput(
    809         config, checkpoint, metadata, new_versions
    810     )

File /venv/lib/python3.12/site-packages/langgraph/pregel/loop.py:808, in AsyncPregelLoop._checkpointer_put_after_previous(self, prev, config, checkpoint, metadata, new_versions)
    806         await prev
    807 finally:
--> 808     await cast(BaseCheckpointSaver, self.checkpointer).aput(
    809         config, checkpoint, metadata, new_versions
    810     )

File /venv/lib/python3.12/site-packages/langgraph/checkpoint/postgres/aio.py:267, in AsyncPostgresSaver.aput(self, config, checkpoint, metadata, new_versions)
    258 copy = checkpoint.copy()
    259 next_config = {
    260     "configurable": {
    261         "thread_id": thread_id,
   (...)
    264     }
    265 }
--> 267 async with self._cursor(pipeline=True) as cur:
    268     await cur.executemany(
    269         self.UPSERT_CHECKPOINT_BLOBS_SQL,
    270         await asyncio.to_thread(
   (...)
    276         ),
    277     )
    278     await cur.execute(
    279         self.UPSERT_CHECKPOINTS_SQL,
    280         (
   (...)
    287         ),
    288     )

File /usr/local/lib/python3.12/contextlib.py:217, in _AsyncGeneratorContextManager.__aexit__(self, typ, value, traceback)
    215 if typ is None:
    216     try:
--> 217         await anext(self.gen)
    218     except StopAsyncIteration:
    219         return False

File /venv/lib/python3.12/site-packages/langgraph/checkpoint/postgres/aio.py:340, in AsyncPostgresSaver._cursor(self, pipeline)
    336             await self.pipe.sync()
    337 elif pipeline:
    338     # a connection not in pipeline mode can only be used by one
    339     # thread/coroutine at a time, so we acquire a lock
--> 340     async with self.lock, conn.pipeline(), conn.cursor(
    341         binary=True, row_factory=dict_row
    342     ) as cur:
    343         yield cur
    344 else:

File /usr/local/lib/python3.12/contextlib.py:217, in _AsyncGeneratorContextManager.__aexit__(self, typ, value, traceback)
    215 if typ is None:
    216     try:
--> 217         await anext(self.gen)
    218     except StopAsyncIteration:
    219         return False

File /venv/lib/python3.12/site-packages/psycopg/connection_async.py:398, in AsyncConnection.pipeline(self)
    395         pipeline = self._pipeline = AsyncPipeline(self)
    397 try:
--> 398     async with pipeline:
    399         yield pipeline
    400 finally:

File /venv/lib/python3.12/site-packages/psycopg/_pipeline.py:266, in AsyncPipeline.__aexit__(self, exc_type, exc_val, exc_tb)
    264         logger.warning("error ignored terminating %r: %s", self, exc2)
    265     else:
--> 266         raise exc2.with_traceback(None)
    267 finally:
    268     self._exit(exc_val)

Description
UntranslatableCharacter Exception When Processing Input with Null Character (\x00) or ('x0000)
Description
I encountered an UntranslatableCharacter exception when attempting to process input containing a null character (\x00) using the langgraph library. The exception occurs when invoking the graph with a message that includes the null character.
To Reproduce

Set up the environment:

Python version: 3.12
Ensure langgraph and its dependencies are installed (including psycopg for PostgreSQL interaction).

Use the following code snippet:
graph = create_react_agent(model, tools=tools, checkpointer=checkpointer)
config = {"configurable": {"thread_id": "6"}}
res = await graph.ainvoke(
    {"messages": [("human", "what's the \x00 weather in nyc")]}, config
)
checkpoint_tuples = [c async for c in checkpointer.alist(config)]

Run the code and observe the exception.

Expected Behavior
The system should handle inputs containing null characters gracefully, either by processing the input correctly or by providing a clear and informative error message indicating that null characters are not supported.
Actual Behavior
An UntranslatableCharacter exception is raised, and the process fails with the following stack trace:
System Info
langgraph==0.2.26
langgraph-checkpoint==1.0.11
langgraph-checkpoint-postgres==1.0.8
langchain==0.3.0
langchain-community==0.3.0
langchain-core==0.3.5
langchain-elasticsearch==0.3.0
langchain-google-community==2.0.0
langchain-openai==0.2.0
langchain-text-splitters==0.3.0
langchain-unstructured==0.1.4
langchainhub==0.1.21

@istvancsabakis thanks for reporting -- this is fixed in langgraph-checkpoint-postgres==1.0.9. please let me know if you run into any other issues!


Issue #1006 Use ubi instead of centos as base image

dnsmasq rpm now available on ubi-8-appstream repo, so better to use
ubi then centos base image.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1766581

After some quick tests we can use this instead.


[Improvement][Alert]Alert problem repair and optimization

Fix mybatis-plus empty value update problem

When deleting the alert-plugin instance, determine whether there is an alert group association

When the alert is executed, if the alarm group is not bound to the alert plug-in, the alert status is updated to fail.

Codecov Report

Merging #4572 (b23696c) into dev (891df6d) will decrease coverage by 0.05%.
The diff coverage is 37.50%.

@@             Coverage Diff              @@
##                dev    #4572      +/-   ##
============================================
- Coverage     44.73%   44.68%   -0.06%
+ Complexity     3343     3338       -5
============================================
  Files           530      530
  Lines         22838    22848      +10
  Branches       2669     2671       +2
============================================
- Hits          10217    10210       -7
- Misses        11702    11715      +13
- Partials        919      923       +4

Impacted Files
Coverage Δ
Complexity Δ

...i/service/impl/AlertPluginInstanceServiceImpl.java
1.29% <0.00%> (-0.16%)
1.00 <0.00> (ø)

...lphinscheduler/dao/entity/AlertPluginInstance.java
96.55% <ø> (ø)
13.00 <0.00> (ø)

...che/dolphinscheduler/alert/runner/AlertSender.java
89.41% <71.42%> (-1.07%)
14.00 <0.00> (ø)

.../org/apache/dolphinscheduler/api/enums/Status.java
100.00% <100.00%> (ø)
5.00 <0.00> (ø)

...inscheduler/service/zk/CuratorZookeeperClient.java
60.97% <0.00%> (-4.88%)
7.00% <0.00%> (-1.00%)

...e/dolphinscheduler/remote/NettyRemotingClient.java
50.00% <0.00%> (-2.78%)
9.00% <0.00%> (-2.00%)

...inscheduler/common/thread/ThreadPoolExecutors.java
19.23% <0.00%> (-1.93%)
3.00% <0.00%> (-2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 891df6d...1f6634a. Read the comment docs.

Codecov Report

Merging #4572 (b23696c) into dev (891df6d) will decrease coverage by 0.05%.
The diff coverage is 37.50%.

@@             Coverage Diff              @@
##                dev    #4572      +/-   ##
============================================
- Coverage     44.73%   44.68%   -0.06%
+ Complexity     3343     3338       -5
============================================
  Files           530      530
  Lines         22838    22848      +10
  Branches       2669     2671       +2
============================================
- Hits          10217    10210       -7
- Misses        11702    11715      +13
- Partials        919      923       +4

Impacted Files
Coverage Δ
Complexity Δ

...i/service/impl/AlertPluginInstanceServiceImpl.java
1.29% <0.00%> (-0.16%)
1.00 <0.00> (ø)

...lphinscheduler/dao/entity/AlertPluginInstance.java
96.55% <ø> (ø)
13.00 <0.00> (ø)

...che/dolphinscheduler/alert/runner/AlertSender.java
89.41% <71.42%> (-1.07%)
14.00 <0.00> (ø)

.../org/apache/dolphinscheduler/api/enums/Status.java
100.00% <100.00%> (ø)
5.00 <0.00> (ø)

...inscheduler/service/zk/CuratorZookeeperClient.java
60.97% <0.00%> (-4.88%)
7.00% <0.00%> (-1.00%)

...e/dolphinscheduler/remote/NettyRemotingClient.java
50.00% <0.00%> (-2.78%)
9.00% <0.00%> (-2.00%)

...inscheduler/common/thread/ThreadPoolExecutors.java
19.23% <0.00%> (-1.93%)
3.00% <0.00%> (-2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 891df6d...1f6634a. Read the comment docs.

+1

+1

Test coverage ?

Test coverage ?


HTTPD mod_wsgi aliases

Description
When using connexion with httpd and mod_wsgi aliases the swagger.json URL is not being generated correctly.
In order to have more than one mod_wsgi script running on a single httpd instance aliases are used. For example...
WSGIScriptAlias /myalias /path/to/my/mod_wsgi/script.wsgi
So the URL for this mod_wsgi script would be...
www.mydomain.com/myalias
Now making the swagger base_path='/api' the ui URL would be...
www.mydomain.com/myalias/api/ui
This all works perfectly fine accept when the swagger.json url is generated. Connexion does not know anything about  the alias that is configured in the httpd.conf file and so it is not using it to generates the swagger.json URL so the URL ends up looking like this...
www.mydomain.com/api/swagger.json
which is not correct. In this case it should be...
www.mydomain.com/myalias/api/swagger.json
If you manually set the swagger.json path correctly in the base_url input field things will work fine.
Everything also works fine when you set the WSGIScript Alias to something like this...
WSGIScriptAlias / /path/to/my/mod_wsgi/script.wsgi
This is effectively like not having an alias, However in many situations this is not possible as you can only set one of these blank alias per httpd virtual host.
I have been reading through the connexion source but have not come up with a good fix for this yet.

I see the problem. I think the issue is with this line in swagger_ui_index: https://github.com/zalando/connexion/blob/master/connexion/api.py#L309
self.base_url does not know about your alias, but it's used as a template variable for Swagger UI index.html to point to swagger.json.
I think the function swagger_ui_index could either use the request's Host header or we simply use a relative path to point to swagger.json in index.html. Feel free to do a PR.

I finally had a some time to look into this. using the "flask.request.url_root" variable in the swagger_ui_index function works perfectly. unfortunately the url's generated by the "Try Out" buttons on the swagger UI page are still missing the alias. currently looking into why.

@Majoros would you be willing to do a PR with the fix? Thanks!

Absolutely, as soon as I figure-out a good solution.


Cursor takes too long to respond

cursor's response time has also increased too much, I want something that doesn't come back, it does wrong when it returns, I don't know exactly why the problem is doing this, but it needs to be fixed, and it's been like this for a few days, I've been deleting the cache file, but it doesn't work, I'm using another model, it's coming back to the same state, and then I'm using a low model again, the same

You want a stable network environment, and the prompt word is also very important, if the card can try to change your cursor machine code.

sorry composer has wrong


Octopus Product code/Tariff code not accpeted

Describe the bug
On upgrading from 0.125.0 to  0.126.2 I find that the information from Octopus Energy reading unit price  in no longer available.
The error I get is 'failed configuring grid tariff: cannot create tariff type 'octopusenergy': missing product code', but as you can see, it is there and I have made no changes from previous version.   I have verified the product code with the Octopus API, and I can manually see the relevant tariff rate by:
https://api.octopus.energy/v1/products/GO-VAR-22-10-14/electricity-tariffs/E-1R-GO-VAR-22-10-14-A/standard-unit-rates/
or
https://api.octopus.energy/v1/products/GO-VAR-22-10-14
Looking at the code in octopus.go and my use case is where I do not use the API key, so looking on how that error in generated, well I am not sure how that part of the code works, but it feels like something is amiss here.
Steps to reproduce

Upgrade from 0.125.0 to 0.126.2

...
Configuration details
<details><summary>Konfiguration (/etc/evcc.yaml)</summary>

network:
  schema: http
  host: evcc.local # .local suffix announces the hostname on MDNS
  port: 7070

log: debug
levels:
  cache: error

# unique installation id
plant: *****

interval: 5s # control cycle interval

sponsortoken: *****

# sponsors can set telemetry: true to enable anonymous data aggregation
# see https://github.com/evcc-io/evcc/discussions/4554
telemetry: false

meters:
- type: template
  template: eastron-sdm220_230
  id: 1
  device: /dev/serial0
  baudrate: 9600
  comset: 8N1
  usage: grid
  modbus: rs485serial
  name: grid1
- type: template
  template: solaredge-inverter
  id: 1
  host: <IP_ADDRESS>
  port: 1502
  usage: pv
  modbus: tcpip
  timeout: 10s
  name: pv1

- type: template
  template: victron-energy
  usage: battery
  host: <IP_ADDRESS>
  port: 502
  capacity: 9
  name: battery1

chargers:
- type: template
  template: keba
  host: <IP_ADDRESS>
  rfid: A63DB84B
  name: BMW_Wallbox
- name: plug_charger
  type: template
  template: tapo
  host: <IP_ADDRESS> # IP-Adresse oder Hostname
  user: *****
  password: *****
  standbypower: 15 # Leistung oberhalb des angegebenen Wertes wird als Ladeleistung gewertet (optional)type: template

loadpoints:
- title: BMW Wallbox
  charger: BMW_Wallbox
  mode: pv
  phases: 1
  mincurrent: 6
  maxcurrent: 32
- title: Plug Charger
  charger: plug_charger
  mode: off

site:
  title: FM1
  meters:
    grid: grid1
    pv:
     - pv1
    battery:
     - battery1
  residualPower: -350

# tariffs are the fixed or variable tariffs
# cheap (tibber/awattar) can be used to define a tariff rate considered cheap enough for charging
#tariffs:
#  currency: GBP # three letter ISO-4217 currency code (default EUR)
tariffs:
  currency: GBP
  grid:
    type: octopusenergy
#    tariff: E-1R-GO-VAR-22-10-14-A
    tariff: GO-VAR-BB-23-02-07
#    tariff: GO-VAR-22-10-14
    region: A

#  grid:
    # either static grid price
#    type: fixed
#    price: 0.41653 # GBP/kWh

    # # or variable via tibber
    # type: tibber
    # cheap: 0.2 # EUR/kWh
    # token: *****
    # homeid: "cc83e83e-8cbf-4595-9bf7-c3cf192f7d9c" # optional if multiple homes associated to account

    # # or variable via awattar
    # type: awattar
    # cheap: 0.2 # EUR/kWh
    # region: de # optional, choose at for Austria
  feedin:
    # rate for feeding excess (pv) energy to the grid
    type: fixed
    price: 0.00 # GBP/kWh

mqtt:
  broker: <IP_ADDRESS>:1883
  topic: evcc # root topic for publishing, set empty to disable
  # user: *****
  # password: *****

</details>
Version: `0.126.2`

Log details
main  ] INFO 2024/05/06 19:33:55 evcc 0.126.2
[main  ] INFO 2024/05/06 19:33:55 using config file: /etc/evcc.yaml
[main  ] INFO 2024/05/06 19:33:55 starting ui and api at :7070
[db    ] INFO 2024/05/06 19:33:55 using sqlite database: /home/jraubal/.evcc/evcc.db
[mqtt  ] INFO 2024/05/06 19:33:55 connecting evcc-907283016 at tcp://<IP_ADDRESS>:1883
[mqtt  ] DEBUG 2024/05/06 19:33:55 tcp://<IP_ADDRESS>:1883 connected
[tapo  ] DEBUG 2024/05/06 19:33:56 SMART.TAPOPLUG P110 connected (fw:1.3.0 Build 230905 Rel.152200,hw:1.0,mac:98-25-4A-93-6A-DE)
[main  ] ERROR 2024/05/06 19:33:56 failed configuring grid tariff: cannot create tariff type 'octopusenergy': missing product code
[lp-1  ] DEBUG 2024/05/06 19:33:56 charge total import: 14162.473kWh

What type of operating system are you running?
Linux
Version
0.126.2

Just. tested using API key, and that configuration works as expected.  It seems to be only an issue with a config where API key is not used and the product code and region code is used.

/cc @duckfullstop

Apologies for the regression, I'll have a fix for this tonight. 🙇

@realist625 Just an FYI that the fix simply allows the deprecated tariff flag to work: please switch to productCode as per the deprecation warning you (should!) now be receiving. (this'll be fixed in documentation with https://github.com/evcc-io/docs/pull/509)


Expiration time for C.DAT auth token

When I use the auth webpage alternative method of logging in, the auth token in C.DAT only seems to last a few days before expiring, and then I have to generate a new one.. is this normal? It makes the transfer process somewhat inconvenient.. would it be possible to make a token that lasts a week, or a month?

The device should be able to keep the token updated using it's refresh token. If the refresh token expires as well then you'll have to generate a new C.dat

Is there any other way to generate the token for the app? Right know your app isnt approved @Bostwickenator


Docs

Adds new doc structure up-to-date with new toolbox structure
closes #22

Codecov Report

Merging #29 into master will not change coverage.
The diff coverage is 80.00%.

@@           Coverage Diff           @@
##           master      #29   +/-   ##
=======================================
  Coverage   61.01%   61.01%
=======================================
  Files          63       63
  Lines        3817     3817
  Branches      496      496
=======================================
  Hits         2329     2329
  Misses       1360     1360
  Partials      128      128

Impacted Files
Coverage Δ

examples/AV/example_runner_drl_av.py
57.14% <ø> (ø)

src/ast_toolbox/spaces/example_av_spaces.py
92.45% <50.00%> (ø)

src/ast_toolbox/simulators/example_av_simulator.py
93.18% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86d0e74...23973fb. Read the comment docs.


chore: add changeset for scriptLoadingDocument fix

PS: ideally 724c9dbeeae76baaeff6e37afd90198a27e2c7a6 would also require a changeset, but I am not adding one (if it's ok with you of course 🙂) just to test the inter-packages dependency flow 🙂


wraparound semantics

Hi,
I am trying to validate the applicability of this library for my usecase, but I am not clear on the wraparound semantics as you described it.
I have a MPSC setup, where producers will need to save pointers to preallocated addresses (8 byte), so I thought the ring buffer could be used for that, as each producer would request a fixed length 8-byte slot to save the pointer vale to. It appears to me if my ring buffer size is multiple of 8-bytes there wouldn't be wrap around applicable. is that correct understanding?
regards

Hi,
Well, the buffer will always have to wrap around at some point.  Do you mean the case when some space at the end of the buffer would be sacrificed to provide a contiguous allocation?  In such case, if the buffer size is dividable by the allocation unit size (assuming it's fixed, e.g. 8 bytes), then it would not happen.  However, since this ring buffer is lock-free, there are some implications -- please see the "Caveats" section in the updated README file.  Also, check the unit tests in the t_ringbuf.c file for examples.
P.S. I have changed the API so that it would not assume threads.

Thanks you have answered my question. How do you handle a scenario where all the space available is taken up by "busy" producers that have not yielded the space (ie did not call ringbuf_produce(r, tls)), what happens when a new producer tries to acquire allocation from the buffer?
btw I think it is a smart move to abstract away threads

Not sure what exactly is your question. You can think of ringbuf_acquire as a reservation, where ringbuf_produce is a "commit".  You cannot rollback, though.  If there is no more space left in the ring buffer, then ringbuf_acquire will indicate that by returning -1.  It is up to the caller how it handles this situation, because there can be different strategies (e.g. spin-wait and retry, sleep using a conditional variable or an equivalent mechanism, perhaps synchronise using eventfd, etc).

Resolved.


{Pylint} Fix unrecognized-inline-option

Description
The correct format to suppress a checker is
# pylint: disable=unused-import

These formats are invalid and never worked, but Pylint didn't give error, meaning they are redundant. so we should remove them.

Pylint

/azp run


[::-1] returns wrong index for 'range' type

Code
a = range(10)
a = a[::-1]
print(a)

Expected
range(9, -1, -1)

Result
range(0, 10, -1)

Another slightly more complicated example:
RustPython
>>>>> range(0, 10, -1)[::-1]
range(0, 10)

CPython
>>> range(0, 10, -1)[::-1]
range(1, 1)

I'd love to work on this as a first issue, if others wouldn't mind.

can I take this?

I've already started but if I'll let you know if I give up on it.  I know where the problem is, though - PyRange::getitem

Making progress.  Found another range slicing bug which I will also try to fix.
RustPython
>>>>> range(0, -10)[::0]
range(0, -10, 0)

CPython
>>> range(0, -10)[::0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: slice step cannot be zero

@vazrupe Sorry!  But, I would love for you to review my PR :)


Unknown hosts not ignored

Steps to reproduce the problem:

Ignore an host impossible to resolve with your current DNS server
Make a request to this DNS name

What is the expected behavior?
The request is ignored and not displayed
What went wrong?
The request is displayed as failed: Server connection to rx-v579:80 failed: Error connecting to "rx-v579": [Errno 8] nodename nor servname provided, or not known
Any other comments? What have you tried so far?
I have an application on my Android phone making requests to my AVR. Which is not exposed outside of my LAN. When I'm at the office, I have requests to this domain all day long and can't ignore them.
I tried to ignore rx-v579 and some regex variants, with no luck.

Mitmproxy Version: 0.17.1
Operating System: OS X 10.11.4

Thanks. Which proxy mode is that? Is the request TLS-encrypted? Can you provide a simple curl statement to reproduce the issue?

It's in "default" proxy mode: the only option was the ignored hosts. The requests were plain HTTP requests. I'll try with curl as soon as I have a laptop handy.

So, I just made a simple test. Being home, the rx-v579 host shown in the original issue has a DNS entry, so I made the test with the non-existing host rx-v, but the issue is exactly the same.

I start mitmproxy on port 8090.
I add to the ignore list rx-v (without port or anything, just rx-v).
I run this curl command: http_proxy=http://localhost:8090 curl http://rx-v/test. It's giving me this HTML, which I don't have without using mitmproxy:

<html>
            <head>
                <title>502 Bad Gateway</title>
            </head>
            <body>ProtocolException('Server connection to rx-v:80 failed: Error connecting to "rx-v": [Errno 8] nodename nor servname provided, or not known',)</body>
        </html>

At this point, I have an entry in mitmproxy:
>> GET http://rx-v/test
       ← Server connection to rx-v:80 failed: Error connecting to "rx-v": [Errno 8] nodename nor servname provided, or not known

Alright, more information on that: the fact that the host is unknown doesn't seem to be the root of the problem. If I'm adding rx-v579 to the ignore list, then making a request to rx-v579 (same curl call as earlier, but with the correct hostname), rx-v579 being an actual host on my network and returning a 200 OK for this request, I can see the entry on mitmproxy. Maybe the fact that the request is directed to an hostname instead of a FQDN is confusing mitmproxy?

It looks like you are running in the limitations listed in http://docs.mitmproxy.org/en/stable/features/passthrough.html#how-it-works ?

I don't understand exactly what is an explicit HTTP request? But yeah, that's probably this.

explicit in the sense that it's explicitly considering a proxy.
Would mitmproxy's "Limit" feature to just hide the flow in the UI solve your issue? If so, we should improve the documentation here.

That's indeed more clearer, thanks. limit = !(~d rx-v579) is exactly what I was looking for 👍

refs #542

Thanks!


ci: build docs on last node

Distribute the load and build docs correctly on the last node.
Signed-off-by: Anas Nashif<EMAIL_ADDRESS>

Codecov Report

Merging #11286 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #11286   +/-   ##
=======================================
  Coverage   51.55%   51.55%
=======================================
  Files         216      216
  Lines       27659    27659
  Branches     6934     6934
=======================================
  Hits        14260    14260
  Misses      10652    10652
  Partials     2747     2747

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6316d77...8579641. Read the comment docs.


Error: The 'page' directive expects a string surrounded by double quotes.(RZ1016)

[Enter feedback here]
Issue found in example code:
for below Page directive to work
@page "{id:int?}"
you need to remove the double quotes around @item.ID in Index.chtml.
The reference error code is:
The 'page' directive expects a string surrounded by double quotes.(RZ1016)
Please re-visit and clarify.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: f71b0095-5175-f2e8-1db2-a800e0f77ce2
Version Independent ID: 6886d687-d6bf-2652-4583-5de7b7353e45
Content: Part 5, update the generated pages
Content Source: aspnetcore/tutorials/razor-pages/da1.md
Product: aspnet-core
Technology: aspnetcore-tutorials
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

@visheshcallin  just tested sample in https://github.com/dotnet/AspNetCore.Docs/pull/26046/files and it works fine.


Neumann2023

Pull Request
This PR is for a

[X] New Publication(s)
[ ] Correction

For the following list(s):

[ ] ancientmetagenome-environmental (README)
[ ] ancientmetagenome-hostassociated (README)
[X] ancientsinglegenome-hostassociated (README)

New Publication
Publication Information
This pull request is to add samples from the following publication(s): https://austriaca.at/bronzezeit-pest-in-drasenhofen
This is to close #1092
Checklist

[x] Publication is published (preprints currently not accepted)?
[x] Checked the publication is not already in the database?
[x] Checked samples in this publication are not previously published data (newly re-sequenced metagenomes are OK!)?
[x] Samples are shotgun metagenomes (hostassociated-singlegenome may also contain whole-genome enriched data)?
[x] Checked the list follows conventions as described in the corresponding sample type's README file (e.g. using ERS/SRS accession codes for ENA/SRA)?
[] Changelog is updated to include the publication under 'Added'?
[ ] Pull request has passed validation checks (see automated comment from github-bot)?
[x] Review requested from @SPAAM-community/ancientmetagenomedir?
[x] (If applicable) Made a separate PR to add new categories to controlled lists (stored under /assets/enums, e.g. material or archive)? If so the corresponding PR is here:

library_polymerase as always in a different dimension
also didn't find a doi

Bug was due to https://github.com/SPAAM-community/AMDirT/issues/125, I've pinned the JSONschema package for you and will keep that temporarily now

Single stranded for the shotgun sequence liraries (2 missing from library list!), and this was with no UDG treatmenment
Added the two libraries

Also the Gansauge is also cited for the capture libraries so they should also be singlestranded not doublre
changed

Polymerase for Gansauge 2020 is: AccuPrime Pfx DNA
added

I approve on behalf of @GUNeumann as his requested changes overlapped with mine and/or has been addressed as requested


url of installation not right

The link belong to Installation section in README is not right.
Current URL  directs to http://neon.nervanasys.com/docs/latest/user_guide.html#installation.
Hope you can fix. Thanks

Thanks, we'll fix this. Here is the link to the installation section: http://neon.nervanasys.com/docs/latest/installation.html


Support for labels through CLI

📚 Documentation preview 📚: https://ploomber-doc--208.org.readthedocs.build/en/208/

lg. please merge once the feature is merged and released


Refactor LinkedIn Profile Fetching Code

This PR reflects the changes required in code to insert/update record on each LinkedIn profile fetched from API as well as merging fetching and email digest into single task.
Pull request checklist

[x] My code contains tests covering the code I modified
[x] I linted and tested the project with bin/check
[ ] I added significant changes and product updates to the changelog

Hi @joemasilotti I have done the discussed changes in the code but I wanted to clarify on below points before proceeding any changes in the code for it.

I see that in rake file we have added condition to execute task only on every 21st but I think we want to run it adhoc so wanted to confirm if I should remove this condition for now or you want to still keep it scheduled for 21st
https://github.com/joemasilotti/railsdevs.com/blob/e412e51a99f75919e2e85b321def60f971f6d56c/lib/tasks/linkedin.rake#L5

I observed that there were changes in code wherein we are emailing only profiles updated in last month but I think it should be last 30 days as we are now combining both tasks.

https://github.com/joemasilotti/railsdevs.com/blob/main/app/models/email_digests/linkedin_profiles.rb#L4
I think we should change code to fetch profiles between 30.days.ago .. Time.now
Thanks

I observed that there were changes in code wherein we are emailing only profiles updated in last month but I think it should be last 30 days as we are now combining both tasks.

We have to make a decision before moving ahead here. Is this a task that is run on the 1st of every month? Or adhoc?
If on the first then we can change 21 to 1 and keep all the "last month" type logic. If adhoc then we need a way to know when an external profile was last fetched (not necessarily updated). And only query for their new data if 30 days has past.
I'd love to see the adhoc workflow working but it might add more complexity. What do you think?

Hi @joemasilotti, as per our discussion, I have implemented the necessary code changes to enable running the LinkedIn task on an ad hoc basis. Now, when we run the task, it will only fetch developers who haven't been updated in the last 30 days. This way, we can avoid making repetitive API calls for the same profiles. Additionally, the admin will be notified only about the profiles whose data has been updated in the last 30 days.
Please review the changes and let me know if you require any further modifications.