Skip to content

Commit e0950f4

Browse files
Fix deadlock (#2292)
* make a write pool * use blocking_write for all graph mutations * enable tests * chore: apply tidy-public auto-fixes * fix the recursive read deadlock * chore: apply tidy-public auto-fixes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b81c0c1 commit e0950f4

8 files changed

Lines changed: 251 additions & 205 deletions

File tree

.github/workflows/test_during_pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
pull_request:
44
branches:
55
- master
6+
- "0.16"
67

78
concurrency:
89
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

docs/reference/graphql/graphql_API.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,43 +2530,43 @@ Uses Tantivy's exact search.
25302530
</thead>
25312531
<tbody>
25322532
<tr>
2533-
<td colspan="2" valign="top"><strong id="graphalgorithmplugin.pagerank">pagerank</strong></td>
2534-
<td valign="top">[<a href="#pagerankoutput">PagerankOutput</a>!]!</td>
2533+
<td colspan="2" valign="top"><strong id="graphalgorithmplugin.shortest_path">shortest_path</strong></td>
2534+
<td valign="top">[<a href="#shortestpathoutput">ShortestPathOutput</a>!]!</td>
25352535
<td></td>
25362536
</tr>
25372537
<tr>
2538-
<td colspan="2" align="right" valign="top">iterCount</td>
2539-
<td valign="top"><a href="#int">Int</a>!</td>
2538+
<td colspan="2" align="right" valign="top">source</td>
2539+
<td valign="top"><a href="#string">String</a>!</td>
25402540
<td></td>
25412541
</tr>
25422542
<tr>
2543-
<td colspan="2" align="right" valign="top">threads</td>
2544-
<td valign="top"><a href="#int">Int</a></td>
2543+
<td colspan="2" align="right" valign="top">targets</td>
2544+
<td valign="top">[<a href="#string">String</a>!]!</td>
25452545
<td></td>
25462546
</tr>
25472547
<tr>
2548-
<td colspan="2" align="right" valign="top">tol</td>
2549-
<td valign="top"><a href="#float">Float</a></td>
2548+
<td colspan="2" align="right" valign="top">direction</td>
2549+
<td valign="top"><a href="#string">String</a></td>
25502550
<td></td>
25512551
</tr>
25522552
<tr>
2553-
<td colspan="2" valign="top"><strong id="graphalgorithmplugin.shortest_path">shortest_path</strong></td>
2554-
<td valign="top">[<a href="#shortestpathoutput">ShortestPathOutput</a>!]!</td>
2553+
<td colspan="2" valign="top"><strong id="graphalgorithmplugin.pagerank">pagerank</strong></td>
2554+
<td valign="top">[<a href="#pagerankoutput">PagerankOutput</a>!]!</td>
25552555
<td></td>
25562556
</tr>
25572557
<tr>
2558-
<td colspan="2" align="right" valign="top">source</td>
2559-
<td valign="top"><a href="#string">String</a>!</td>
2558+
<td colspan="2" align="right" valign="top">iterCount</td>
2559+
<td valign="top"><a href="#int">Int</a>!</td>
25602560
<td></td>
25612561
</tr>
25622562
<tr>
2563-
<td colspan="2" align="right" valign="top">targets</td>
2564-
<td valign="top">[<a href="#string">String</a>!]!</td>
2563+
<td colspan="2" align="right" valign="top">threads</td>
2564+
<td valign="top"><a href="#int">Int</a></td>
25652565
<td></td>
25662566
</tr>
25672567
<tr>
2568-
<td colspan="2" align="right" valign="top">direction</td>
2569-
<td valign="top"><a href="#string">String</a></td>
2568+
<td colspan="2" align="right" valign="top">tol</td>
2569+
<td valign="top"><a href="#float">Float</a></td>
25702570
<td></td>
25712571
</tr>
25722572
</tbody>

python/python/raphtory/__init__.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ from os import PathLike
2525
import networkx as nx # type: ignore
2626
import pyvis # type: ignore
2727

28-
__all__ = ['GraphView', 'Graph', 'PersistentGraph', 'Node', 'Nodes', 'PathFromNode', 'PathFromGraph', 'MutableNode', 'Edge', 'Edges', 'NestedEdges', 'MutableEdge', 'Properties', 'Metadata', 'TemporalProperties', 'PropertiesView', 'TemporalProp', 'WindowSet', 'IndexSpecBuilder', 'IndexSpec', 'graphql', 'algorithms', 'graph_loader', 'graph_gen', 'vectors', 'node_state', 'filter', 'nullmodels', 'plottingutils']
28+
__all__ = ['GraphView', 'Graph', 'PersistentGraph', 'Node', 'Nodes', 'PathFromNode', 'PathFromGraph', 'MutableNode', 'Edge', 'Edges', 'NestedEdges', 'MutableEdge', 'Properties', 'Metadata', 'TemporalProperties', 'PropertiesView', 'TemporalProp', 'WindowSet', 'IndexSpecBuilder', 'IndexSpec', 'version', 'graphql', 'algorithms', 'graph_loader', 'graph_gen', 'vectors', 'node_state', 'filter', 'nullmodels', 'plottingutils']
2929
class GraphView(object):
3030
"""Graph view is a read-only version of a graph at a certain point in time."""
3131

@@ -5912,3 +5912,6 @@ class IndexSpec(object):
59125912
@property
59135913
def node_properties(self):
59145914
...
5915+
5916+
def version():
5917+
...

python/python/raphtory/graphql/__init__.pyi

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class RaphtoryClient(object):
140140

141141
def copy_graph(self, path: str, new_path: str) -> None:
142142
"""
143-
Copy graph from a path `path` on the server to a `new_path` on the server
143+
Copy graph from a path path on the server to a new_path on the server
144144
145145
Arguments:
146146
path (str): the path of the graph to be copied
@@ -166,7 +166,7 @@ class RaphtoryClient(object):
166166

167167
def delete_graph(self, path: str) -> None:
168168
"""
169-
Delete graph from a path `path` on the server
169+
Delete graph from a path path on the server
170170
171171
Arguments:
172172
path (str): the path of the graph to be deleted
@@ -185,7 +185,7 @@ class RaphtoryClient(object):
185185

186186
def move_graph(self, path: str, new_path: str) -> None:
187187
"""
188-
Move graph from a path `path` on the server to a `new_path` on the server
188+
Move graph from a path path on the server to a new_path on the server
189189
190190
Arguments:
191191
path (str): the path of the graph to be moved
@@ -197,7 +197,7 @@ class RaphtoryClient(object):
197197

198198
def new_graph(self, path: str, graph_type: Literal["EVENT", "PERSISTENT"]) -> None:
199199
"""
200-
Create a new empty Graph on the server at `path`
200+
Create a new empty Graph on the server at path
201201
202202
Arguments:
203203
path (str): the path of the graph to be created
@@ -217,12 +217,12 @@ class RaphtoryClient(object):
217217
variables (dict[str, Any], optional): a dict of variables present on the query and their values.
218218
219219
Returns:
220-
dict[str, Any]: The `data` field from the graphQL response.
220+
dict[str, Any]: The data field from the graphQL response.
221221
"""
222222

223223
def receive_graph(self, path: str) -> Union[Graph, PersistentGraph]:
224224
"""
225-
Receive graph from a path `path` on the server
225+
Receive graph from a path path on the server
226226
227227
Note:
228228
This downloads a copy of the graph. Modifications are not persistet to the server.
@@ -236,7 +236,7 @@ class RaphtoryClient(object):
236236

237237
def remote_graph(self, path: str) -> RemoteGraph:
238238
"""
239-
Get a RemoteGraph reference to a graph on the server at `path`
239+
Get a RemoteGraph reference to a graph on the server at path
240240
241241
Arguments:
242242
path (str): the path of the graph to be created
@@ -256,20 +256,20 @@ class RaphtoryClient(object):
256256
overwrite (bool): overwrite existing graph. Defaults to False.
257257
258258
Returns:
259-
dict[str, Any]: The `data` field from the graphQL response after executing the mutation.
259+
dict[str, Any]: The data field from the graphQL response after executing the mutation.
260260
"""
261261

262262
def upload_graph(self, path: str, file_path: str, overwrite: bool = False) -> dict[str, Any]:
263263
"""
264-
Upload graph file from a path `file_path` on the client
264+
Upload graph file from a path file_path on the client
265265
266266
Arguments:
267267
path (str): the name of the graph
268268
file_path (str): the path of the graph on the client
269269
overwrite (bool): overwrite existing graph. Defaults to False.
270270
271271
Returns:
272-
dict[str, Any]: The `data` field from the graphQL response after executing the mutation.
272+
dict[str, Any]: The data field from the graphQL response after executing the mutation.
273273
"""
274274

275275
class RemoteGraph(object):
@@ -569,7 +569,7 @@ class RemoteEdgeAddition(object):
569569

570570
class RemoteIndexSpec(object):
571571
"""
572-
Create a `RemoteIndexSpec` specifying which node and edge properties to index.
572+
Create a RemoteIndexSpec specifying which node and edge properties to index.
573573
574574
Arguments:
575575
node_props (PropsInput): Property spec for nodes.
@@ -581,22 +581,22 @@ class RemoteIndexSpec(object):
581581

582582
class PropsInput(object):
583583
"""
584-
Create a `PropsInput` by choosing to include all/some properties explicitly.
584+
Create a PropsInput by choosing to include all/some properties explicitly.
585585
586586
Arguments:
587587
all (AllPropertySpec, optional): Use a predefined spec to include all properties of a kind.
588588
some (SomePropertySpec, optional): Explicitly list the properties to include.
589589
590590
Raises:
591-
ValueError: If neither `all` and `some` are specified.
591+
ValueError: If neither all and some are specified.
592592
"""
593593

594594
def __new__(cls, all: Optional[AllPropertySpec] = None, some: Optional[SomePropertySpec] = None) -> PropsInput:
595595
"""Create and return a new object. See help(type) for accurate signature."""
596596

597597
class SomePropertySpec(object):
598598
"""
599-
Create a `SomePropertySpec` by explicitly listing metadata and/or temporal property names.
599+
Create a SomePropertySpec by explicitly listing metadata and/or temporal property names.
600600
601601
Arguments:
602602
metadata (list[str]): Metadata property names. Defaults to [].
@@ -609,7 +609,7 @@ class SomePropertySpec(object):
609609
class AllPropertySpec(object):
610610
"""
611611
Specifies that **all** properties should be included when creating an index.
612-
Use one of the predefined variants: `ALL`, `ALL_METADATA`, or `ALL_TEMPORAL`.
612+
Use one of the predefined variants: ALL , ALL_METADATA , or ALL_TEMPORAL .
613613
"""
614614

615615
def __eq__(self, value):

raphtory-core/src/storage/raw_edges.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl EdgesStorage {
187187
pub fn get_edge(&self, eid: EID) -> EdgeRGuard {
188188
let (bucket, offset) = self.resolve(eid.into());
189189
EdgeRGuard {
190-
guard: self.shards[bucket].read(),
190+
guard: self.shards[bucket].read_recursive(),
191191
offset,
192192
}
193193
}

raphtory-graphql/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,8 @@ type Graph {
925925
}
926926

927927
type GraphAlgorithmPlugin {
928-
pagerank(iterCount: Int!, threads: Int, tol: Float): [PagerankOutput!]!
929928
shortest_path(source: String!, targets: [String!]!, direction: String): [ShortestPathOutput!]!
929+
pagerank(iterCount: Int!, threads: Int, tol: Float): [PagerankOutput!]!
930930
}
931931

932932
type GraphSchema {

0 commit comments

Comments
 (0)